Automatic sensor calibration method and system and medium
Through the automated sensor calibration method, the problem of degradation of measurement accuracy caused by the compensation parameter lag and time synchronization deviation in dynamic temperature environment is solved, and efficient and accurate measurement of the sensor in different environments is achieved.
Patent Information
- Application Number
- CN202510524362.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-07-25
AI Technical Summary
The existing high-precision sensors have reduced measurement accuracy due to compensation parameter lag and time synchronization deviation in dynamic temperature environments. The traditional calibration methods are inefficient and lack real-time verification mechanisms.
The calibration device sends initialization instructions, synchronously collects sensor and master data and aligns the timestamps, builds a temperature-calibration parameter mapping table, dynamically call compensation parameters for temperature compensation, and ensures calibration accuracy with residual analysis.
It realizes efficient and accurate measurement of the sensor in dynamic temperature environment, and improves the measurement stability and reliability of the sensor in different environments.
Smart Images

Figure CN120369023A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent sensor calibration, and particularly to an automated sensor calibration method, system and medium. Background Art
[0002] With the rapid development of the Internet of Things and intelligent sensing technology, sensors are increasingly widely used in fields such as industrial control and environmental monitoring. However, existing high-precision sensor devices need to be calibrated by a master machine (standard reference device) when leaving the factory. However, sensors are easily interfered by factors such as temperature drift and time drift in the actual working environment, resulting in a gradual decline in measurement accuracy. Traditional calibration methods mostly adopt static calibration at fixed temperature points, generating compensation parameters only for a single environmental condition, and it is difficult to adapt to the wide-temperature dynamic change scenario. In addition, the synchronization accuracy of sensor data and master machine reference data during the calibration process is insufficient, and the timestamp deviation will cause the accumulation of fitting errors; while the manual temperature adjustment and step-by-step calibration methods are inefficient, and there is a lack of a real-time verification mechanism for calibration results, which may introduce incorrect parameters and affect the long-term reliability of the sensor. Summary of the Invention
[0003] The purpose of the present invention is to provide an automated sensor calibration method, system and medium to solve the problem of the decline in measurement accuracy caused by the lag of compensation parameters and time synchronization deviation of the sensor in a dynamic temperature environment.
[0004] To achieve the above purpose, in the first aspect of the present invention, an automated sensor calibration method is provided, including the following steps:
[0005] The calibration device sends an initialization instruction to the sensor to be calibrated;
[0006] Synchronously collect sensor data and master machine reference data;
[0007] For the obtained sensor data and master machine reference data, after aligning the timestamps, perform fitting;
[0008] Repeat the calibration steps within a preset temperature range to establish a temperature-calibration parameter mapping table;
[0009] According to the real-time temperature of the sensor, dynamically call the corresponding compensation parameter from the temperature-calibration parameter mapping table, and write the compensation parameter into the sensor to achieve dynamic temperature compensation.
[0010] Preferably, in the automated sensor calibration method described above, the alignment of the acquired sensor data and the master machine reference data and the subsequent fitting after aligning the timestamps include performing time series matching on the sensor data and the master machine reference data through a time alignment algorithm to eliminate time deviation; based on the aligned data, using a linear compensation algorithm and a non-linear compensation algorithm to respectively correct the errors of time drift and temperature drift, and generating a standard time series synchronized with the master machine reference data.
[0011] Preferably, in the automated sensor calibration method described above, the time alignment algorithm includes:
[0012] Calculating the deviation sequence between the timestamp of the sensor and the absolute time of the calibration device;
[0013] Fitting the deviation trend by the least squares method to generate a first-order compensation function or a second-order compensation function;
[0014] Interpolating and correcting the timestamp of the sensor.
[0015] Preferably, in the automated sensor calibration method described above, the establishment of the temperature-calibration parameter mapping table includes:
[0016] Adjusting the ambient temperature by dividing it into at least two sub-intervals at gradients within a preset temperature range;
[0017] Collecting multiple sets of the sensor data and the master machine reference data within each of the sub-intervals;
[0018] Generating compensation parameters for each temperature point through piecewise linear interpolation.
[0019] Preferably, in the automated sensor calibration method described above, before writing the compensation parameters into the sensor, it further includes: performing residual analysis based on the calibrated sensor data and the master machine reference data to determine whether the calibration error exceeds a preset threshold; if not, writing the compensation parameters into the sensor; if so, the data verification of the calibration device fails.
[0020] Preferably, in the automated sensor calibration method described above, when the data verification of the calibration device fails, the following operations are performed:
[0021] Resending the most recent control instruction;
[0022] If the number of consecutive failures exceeds the threshold, terminate the current calibration process and give an alarm.
[0023] Preferably, in the automated sensor calibration method described above, the calibration steps within the preset temperature range include: gradually adjusting the ambient temperature according to a preset temperature gradient, performing data acquisition after reaching a stable state at each temperature point, and associatively storing the compensation parameters at that temperature point in the temperature-calibration parameter mapping table.
[0024] In a second aspect of the present invention, there is also provided an automated sensor calibration system, including a calibration device, a master machine, and a sensor;
[0025] The communication interface of the calibration device is connected to the master machine and the sensor;
[0026] The calibration device is used to send control instructions, collect data, and perform compensation calculations. The calibration device includes an instruction sending module, a synchronous acquisition module, a data processing module, a temperature calibration module, and a dynamic compensation module;
[0027] The master machine is used to output a standard physical quantity value and a timestamp;
[0028] The sensor is configured to collect physical quantity data in real time and attach a timestamp and temperature information, including a temperature sensing unit, a data storage unit, and a parameter execution unit.
[0029] Preferably, in the automated sensor calibration system described above, the data processing module includes a time alignment unit and an error correction unit:
[0030] The time alignment unit is configured to calculate the deviation sequence between the sensor timestamp and the absolute time of the calibration device by the least squares method, generate a first-order or second-order compensation function, and perform interpolation correction;
[0031] The error correction unit includes a linear compensation algorithm processor and a non-linear compensation algorithm processor, which are respectively used to correct the time drift error and the temperature drift error, and generate a standard time series synchronized with the reference data of the master machine.
[0032] In a third aspect of the present invention, there is also provided a computer-readable storage medium, in which program instructions are stored. When the program instructions are executed, they are used to implement the steps of the method in the first aspect above.
[0033] Compared with the prior art, the present invention has at least the following technical effects:
[0034] The present invention sends an initialization instruction to the sensor to be calibrated through a calibration device to clear its historical calibration data and eliminate interference. Subsequently, the sensor data (including physical quantity measurement values, timestamps, and real-time temperature) and the master machine reference data (standard physical quantity values and corresponding timestamps) are synchronously collected, and the timestamps of both are interpolated, corrected, and sequence-matched based on a time alignment algorithm to eliminate clock deviation. By adjusting the ambient temperature in gradients within a preset temperature range, collecting multiple groups of data, and performing piecewise linear interpolation, a temperature-calibration parameter mapping table is constructed. Finally, the compensation parameters in the mapping table are dynamically called according to the real-time temperature of the sensor, and after passing the residual analysis verification, they are written into the sensor, thereby realizing adaptive dynamic compensation in the full temperature range, and solving the problem of the measurement accuracy decline of the sensor caused by the lag of calibration parameters and time synchronization deviation in a dynamic temperature environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flowchart of a method for automatic sensor calibration in an embodiment of the present invention;
[0036] Figure 2 It is a structural diagram of a system for automatic sensor calibration in another embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0037] The following will describe in more detail an automatic sensor calibration method, system, and medium of the present invention with reference to the schematic diagrams, in which the preferred embodiments of the present invention are shown. It should be understood that those skilled in the art can modify the present invention described herein while still achieving the advantageous effects of the present invention. Therefore, the following description should be understood as a broad knowledge for those skilled in the art and not as a limitation to the present invention.
[0038] For clarity, not all features of the actual embodiments are described. In the following description, well-known functions and structures are not described in detail because they would obscure the present invention with unnecessary details. It should be considered that in the development of any actual embodiment, a large number of implementation details must be made to achieve the specific goals of the developer, such as changing from one embodiment to another according to the relevant system or business limitations. Additionally, it should be considered that such development work may be complex and time-consuming, but it is only routine work for those skilled in the art.
[0039] In the following paragraphs, the present invention will be described more specifically by way of example with reference to the accompanying drawings. The advantages and features of the present invention will be clearer according to the following description. It should be noted that the drawings are all in a very simplified form and use non-precise scales, only for the purpose of facilitating and clearly assisting in explaining the embodiments of the present invention.
[0040] In the prior art, high-precision sensor devices need to be calibrated by a master machine (standard reference device) when leaving the factory. However, during long-term operation, factors such as mechanical wear and temperature changes will cause a decline in accuracy. The traditional calibration method has the following defects:
[0041] Time deviation: The data acquisition times of the sensor and the master machine are not synchronized, resulting in fitting errors;
[0042] Temperature influence: The influence of temperature fluctuations on the performance of the sensor chip is not considered, and the compensation parameters are single;
[0043] Manual dependence: The calibration process requires manual operation, with low efficiency and it is difficult to achieve industrial automation.
[0044] In view of this, in view of these limitations of the prior art, on the one hand of this embodiment, as Figure 1 shown, an automated sensor calibration method is proposed to solve the problem of the decline in measurement accuracy of the sensor due to lagging compensation parameters and time synchronization deviation in a dynamic temperature environment. The method includes the following steps:
[0045] S1: The calibration device sends an initialization instruction to the sensor to be calibrated;
[0046] S2: Synchronously collect sensor data and master machine reference data;
[0047] S3: For the obtained sensor data and master machine reference data, after aligning the timestamps, perform fitting;
[0048] S4: Repeat the calibration steps within a preset temperature range to establish a temperature-calibration parameter mapping table;
[0049] S5: According to the real-time temperature of the sensor, dynamically call the corresponding compensation parameters from the temperature-calibration parameter mapping table, and write the compensation parameters into the sensor to achieve dynamic temperature compensation
[0050] In step S1, the calibration device sends an initialization instruction to the sensor through the communication bus, clears the historical calibration data stored inside the sensor, ensures that the calibration process is executed based on a brand-new data environment, and avoids the influence of historical error accumulation on subsequent data acquisition and fitting accuracy.
[0051] Specifically, in step S2, the collected sensor data includes the measured value of the physical quantity of the sensor obtained in real time, and is appended with the timestamp generated by its internal clock and the real-time temperature detected by the temperature sensor. The collected master machine reference data includes the standard physical quantity value provided by the master machine synchronously and the corresponding absolute timestamp.
[0052] Further, in step S3, the fitting of the acquired sensor data and the master machine reference data after aligning the timestamps includes: performing time series matching on the sensor data and the master machine reference data through a time alignment algorithm to eliminate time deviation; based on the aligned data, using a linear compensation algorithm and a non-linear compensation algorithm to correct the errors of time drift and temperature drift respectively, and generating a standard time series synchronized with the master machine reference data.
[0053] Among them, the time alignment algorithm includes: calculating the deviation sequence between the timestamps in the sensor data and the absolute time of the calibration device; fitting the deviation trend through the least squares method to generate a first-order compensation function or a second-order compensation function; performing interpolation correction on the timestamps of the sensor to achieve precise matching of the time series between the sensor and the master machine.
[0054] Further, based on the aligned data, a linear compensation algorithm is used to correct time drift (such as clock cumulative error), and a non-linear compensation algorithm is used to correct the error of temperature drift (such as non-linear temperature drift of the sensor), and a standard time series synchronized with the master machine reference data is generated.
[0055] In addition, in step S4, the steps of the method for establishing the temperature-calibration parameter mapping table include:
[0056] S41: Temperature range division
[0057] Adjust the ambient temperature by dividing it into at least two sub-ranges at a gradient within a preset temperature range.
[0058] S42: Gradient temperature adjustment
[0059] Collect multiple groups of the sensor data and the master machine reference data within each sub-range.
[0060] S43: Piecewise interpolation to generate parameters
[0061] Generate compensation parameters for each temperature point through piecewise linear interpolation.
[0062] Specifically, the calibration steps within the preset temperature range include: gradually adjusting the ambient temperature according to a preset temperature gradient, performing data collection after reaching a stable state at each temperature point, and associatively storing the compensation parameters at that temperature point into the mapping relationship table of temperature-compensation parameters.
[0063] In this embodiment, according to step S4, the working temperature range of the sensor (such as -40°C to 85°C) is divided into at least two sub-intervals (for example, each 10°C is an interval). The calibration device controls the temperature chamber to gradually adjust the ambient temperature according to a preset gradient. After each temperature point reaches a stable state, repeat the steps of S1 - S3, and collect the sensor data and the master machine reference data at this time. Collect multiple groups of sensor data and master machine reference data within each sub-interval, and generate compensation parameters for each temperature point through piecewise linear interpolation, so as to construct a temperature - calibration parameter mapping table.
[0064] In this embodiment, in step S5, according to the real-time temperature of the sensor, the compensation parameters corresponding to the corresponding temperature point can be dynamically called from the temperature - calibration parameter mapping table. After calibration is completed, write the compensation parameters into the sensor and wait for the next batch of sensors to be connected.
[0065] It should be noted that before writing the compensation parameters into the sensor, it is necessary to monitor the data verification status through the calibration device, specifically including: performing residual analysis based on the calibrated sensor data and the master machine reference data to determine whether the calibration error exceeds a preset threshold; if not, write the compensation parameters into the sensor; if it exceeds, the data verification of the calibration device fails.
[0066] Among them, when the data verification of the calibration device fails, the following operations are performed: resend the last control instruction; if the number of consecutive failures exceeds the threshold, terminate the current calibration process and alarm.
[0067] Specifically, after calculating the residual between the calibrated sensor data and the master machine reference data, if the residual is less than the preset threshold (such as ±0.5%), it is determined that the verification is passed and the calibration parameters are written; if the verification fails (no data or data verification fails), the calibration device automatically resends the last control instruction (such as re-collecting data), and if the number of consecutive failures exceeds the threshold, terminate the current calibration process and alarm.
[0068] In another aspect of this embodiment, as Figure 2 shown, an automated sensor calibration system is proposed, including a calibration device, a master machine, and a sensor; the communication interface of the calibration device is connected to the master machine and the sensor; the calibration device is used to send control instructions, collect data, and perform compensation calculations; the calibration device includes an instruction sending module, a synchronous acquisition module, a data processing module, a temperature calibration module, and a dynamic compensation module.
[0069] Among them, the instruction sending module is configured to send an initialization instruction to the sensor; the synchronous acquisition module is communicatively connected to the master machine and is used to synchronously obtain sensor data and master machine reference data. The sensor data includes physical quantity measurement values, timestamps, and real-time temperatures, and the master machine reference data includes standard physical quantity values and corresponding timestamps; the data processing module is used to fit the sensor data and the master machine reference data after timestamp alignment; the temperature calibration module is configured to repeatedly calibrate within a preset temperature range to generate a temperature-calibration parameter mapping table; the dynamic compensation module is used to call the compensation parameters in the temperature-calibration parameter mapping table according to the real-time temperature of the sensor and write them into the sensor.
[0070] In addition, the calibration device is also provided with a temperature control interface, which is connected to an external temperature chamber to adjust the ambient temperature according to a preset gradient and trigger the synchronous acquisition module to perform data acquisition after stabilizing at each temperature point.
[0071] The master machine includes a reference data generation unit for outputting standard physical quantity values and timestamps.
[0072] The sensor is configured to collect physical quantity data in real time and append timestamp and temperature information, and includes a temperature sensing unit, a data storage unit, and a parameter execution unit. The parameter execution unit receives compensation parameters and corrects the measurement output in real time.
[0073] Further, the data processing module includes a time alignment unit and an error correction unit. The time alignment unit is configured to calculate the deviation sequence between the sensor timestamp and the absolute time of the calibration device by the least squares method, generate a first-order or second-order compensation function and perform interpolation correction; the error correction unit includes a linear compensation algorithm processor and a non-linear compensation algorithm processor, which are respectively used to correct the time drift error and the temperature drift error, and generate a standard time sequence synchronized with the master machine reference data.
[0074] The system can solve the error problems caused by environmental temperature changes and time asynchronization in traditional sensor calibration. Specifically, sensors are prone to be affected by temperature fluctuations during actual use, resulting in measurement value drift. Traditional calibration methods often can only be manually adjusted at a fixed temperature and cannot dynamically adapt to temperature changes; at the same time, the data acquisition times of the sensor and the reference device are not synchronized, resulting in inaccurate comparison. This system automatically synchronizes the data of the sensor and the master machine, eliminates the time deviation, automatically tests at different temperatures, generates a compensation parameter table, and finally dynamically adjusts the calibration parameters according to the real-time temperature to achieve efficient and accurate full-automatic temperature compensation, thereby improving the measurement stability and reliability of the sensor in different environments.
[0075] In another aspect of this embodiment, a computer-readable storage medium is provided. Program instructions are stored in the computer-readable storage medium, and when the program instructions are executed by a processor, some or all of the steps of the automated sensor calibration method in the first aspect of this embodiment can be implemented, so as to solve the problem of the decrease in measurement accuracy of the sensor due to the lag of calibration parameters and the time synchronization deviation in a dynamic temperature environment.
[0076] In summary, for an automated sensor calibration method, system and medium provided in an embodiment of the present invention, an initialization instruction is sent to a sensor to be calibrated through a calibration device to clear its historical calibration data to eliminate interference; subsequently, sensor data (including physical quantity measurement values, timestamps and real-time temperatures) and master reference data (standard physical quantity values and corresponding timestamps) are synchronously collected, and interpolation correction and sequence matching are performed on the timestamps of the two based on a time alignment algorithm to eliminate clock deviation; by adjusting the ambient temperature in a preset temperature range in gradients, collecting multiple groups of data and performing piecewise linear interpolation, a temperature-calibration parameter mapping table is constructed; finally, compensation parameters in the mapping table are dynamically called according to the real-time temperature of the sensor, and after passing the residual analysis verification, they are written into the sensor, thereby realizing adaptive dynamic compensation in the full temperature range, and thus solving the problem of the decrease in measurement accuracy of the sensor due to the lag of calibration parameters and the time synchronization deviation in a dynamic temperature environment.
[0077] The above are only the preferred embodiments of the present invention and do not impose any limitation on the present invention. Any person skilled in the art within the technical field, without departing from the scope of the technical solution of the present invention, any equivalent replacement or modification and other changes made to the technical solution and technical content disclosed by the present invention are all within the content of the technical solution of the present invention and still fall within the protection scope of the present invention.
Claims
1. An automated sensor calibration method, characterized in that, It includes the following steps: The calibration device sends an initialization instruction to the sensor to be calibrated; Synchronously collect sensor data and master machine reference data; For the acquired sensor data and master machine reference data, perform fitting after aligning the timestamps; Repeat the calibration steps within a preset temperature range to establish a temperature-calibration parameter mapping table; According to the real-time temperature of the sensor, dynamically call the corresponding compensation parameters from the temperature-calibration parameter mapping table, and write the compensation parameters into the sensor to achieve dynamic temperature compensation.
2. The automated sensor calibration method according to claim 1, wherein, The performing fitting on the acquired sensor data and master machine reference data after aligning the timestamps includes performing time series matching on the sensor data and master machine reference data through a time alignment algorithm to eliminate time deviation; based on the aligned data, respectively correct the errors of time drift and temperature drift by using a linear compensation algorithm and a nonlinear compensation algorithm to generate a standard time series synchronized with the master machine reference data.
3. The automated sensor calibration method according to claim 2, wherein The time alignment algorithm includes: Calculate the deviation sequence between the timestamp of the sensor and the absolute time of the calibration device; Generate a first-order compensation function or a second-order compensation function by fitting the deviation trend through the least squares method; Perform interpolation correction on the timestamp of the sensor.
4. The automated sensor calibration method according to claim 1, wherein The establishment of the temperature-calibration parameter mapping table includes: Adjust the ambient temperature by dividing it into at least two sub-intervals according to a gradient within a preset temperature range; Collect multiple groups of sensor data and master machine reference data within each sub-interval; Generate compensation parameters for each temperature point through piecewise linear interpolation.
5. The automated sensor calibration method according to claim 1, wherein Before writing the compensation parameters into the sensor, it also includes: performing residual analysis based on the calibrated sensor data and master machine reference data to determine whether the calibration error exceeds a preset threshold; if not, write the compensation parameters into the sensor; if it exceeds, the data verification of the calibration device fails.
6. The automated sensor calibration method according to claim 5, wherein When the data verification of the calibration device fails, it performs the following operations: Resend the last control instruction; If the continuous failure times exceed the threshold, terminate the current calibration process and alarm.
7. The automated sensor calibration method according to claim 1, wherein The calibration steps within the preset temperature range include: gradually adjust the ambient temperature according to a preset temperature gradient, perform data collection after reaching a stable state at each temperature point, and associatively store the compensation parameters at that temperature point into the mapping relationship table of the temperature-calibration parameters.
8. An automated sensor calibration system, characterized in that, It includes a calibration device, a master machine, and a sensor; The communication interface of the calibration device is connected to the master machine and the sensor; The calibration device is used to send control instructions, collect data, and perform compensation calculations. The calibration device includes an instruction sending module, a synchronous acquisition module, a data processing module, a temperature calibration module, and a dynamic compensation module; The master machine is used to output standard physical quantity values and timestamps; The sensor is configured to collect physical quantity data in real time and attach timestamp and temperature information, and includes a temperature sensing unit, a data storage unit, and a parameter execution unit.
9. The automated sensor calibration system according to claim 8, wherein The data processing module includes a time alignment unit and an error correction unit: The time alignment unit is configured to calculate the deviation sequence between the sensor timestamp and the absolute time of the calibration device through the least squares method, generate a first-order or second-order compensation function, and perform interpolation correction; The error correction unit includes a linear compensation algorithm processor and a non-linear compensation algorithm processor, which are respectively used to correct the time drift error and the temperature drift error, and generate a standard time series synchronized with the reference data of the master machine.
10. A computer-readable storage medium, characterized in that, Program instructions are stored in the computer-readable storage medium, and when the program instructions are executed, they are used to implement the steps of the method according to any one of claims 1-7.
Citation Information
Cited By
Sensor intelligent calibration system and method
CN120970709A
Temperature compensation method for data automatic alignment granularity
CN121388371A
Calibration method, device and system for heating type capacitance film vacuum gauge
CN121977748A