A current calibration method and system based on hona rule

CN122944970APending Publication Date: 2026-10-20NANJING SART SCI & TECH DEV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611003575.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

现有电流计算与标定技术的实现方式有:传统线性计算法,采用公式I=V/R直接计算电流,未考虑检测器件在不同温度下的温度漂移和非线性误差,在全温区使用时精度大幅下降,无法满足工业级高精度检测需求;简易温度补偿法,采用单因子线性修正或分段插值法进行温度补偿,前者仅对单一温度点修正,全温区补偿效果差;后者需存储大量插值节点数据,占用硬件存储资源,且计算效率低,无法适配实时检测场景;多项式拟合优化法,采用高次多项式拟合实现误差补偿,但计算高次幂导致乘法运算次数多,计算耗时久,硬件运行过程容易出现故障,设备运行可靠性低

Benefits of technology

[0027]有益效果:本发明相对于现有技术,其显著优点是采用霍纳法则对多项式进行计算优化,嵌套拆解后减少乘法运算次数,实现微秒级电流计算,满足MCU实时检测需求。通过二元三次多项式将温度作为变量融入电流计算,实现-40~125℃宽温区温度漂移与非线性误差的双重补偿,尤其解决了高温段(85℃以上)误差激增问题,全温区内电流检测精度提升至0.1% 以内,远优于传统线性计算法和简易温度补偿法。设置标定系数的校验步骤,进行分级异常处理,在标定系数损坏时切换计算方法,避免系数损坏导致设备停机,提升设备运行的可靠性。温度超-40~125℃边界时进行边界截断计算,保证基础功能可用,大幅提升设备在复杂工业宽温环境中的运行可靠性。算法适配小型化智能标定模组的硬件架构,兼容浮点运算单元(FPU)加速,兼顾计算精度与硬件资源利用率,占用Flash存储资源少,同时选用通用宽温硬件配件,进一步控制成本。算法逻辑简洁,基于通用32位宽温型MCU(支持FPU)即可实现,无需定制化硬件,可直接移植至各类电流检测智能标定设备,适配工业测控、新能源等-40~125℃宽温高精度电流检测场景,具备广泛的工业推广价值。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a current calibration method based on Horner's rule. The method involves obtaining several measured values ​​of a current sensing device at different temperatures and corresponding standard current values ​​through preliminary calibration; fitting the measured values, standard current values, and temperatures using the least squares method; optimizing the polynomial using Horner's rule; storing the calibration coefficients of the optimized polynomial; generating and storing verification values ​​for the coefficients; acquiring the raw voltage and temperature values ​​detected by the current sensing device in real time; reading the calibration coefficients from the storage area; and performing integrity verification on the calibration coefficients using the verification values ​​using a cyclic redundancy check algorithm; after successful verification, calculating the current value using the optimized polynomial based on the calibration coefficients from the standard format data to obtain the calibrated current value. Using Horner's rule to optimize the polynomial calculation reduces the number of multiplication operations and computation time. The inclusion of a calibration coefficient verification step improves the reliability of device operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the calibration of current sensing devices, specifically to a current calibration method and system based on Horner's law. Background Technology

[0002] Current sensing devices are a core component of power measurement and control systems, and their detection accuracy directly determines the reliability of system operation. Existing current calculation and calibration techniques include: traditional linear calculation methods, which directly calculate current using the formula I=V / R, without considering the temperature drift and nonlinear errors of the sensing device under different temperatures. This results in a significant drop in accuracy across the entire temperature range, failing to meet the high-precision detection requirements of industrial applications; simplified temperature compensation methods, which use single-factor linear correction or piecewise interpolation for temperature compensation. The former only corrects a single temperature point, resulting in poor compensation across the entire temperature range; the latter requires storing a large amount of interpolation node data, consuming significant hardware storage resources and exhibiting low computational efficiency, making it unsuitable for real-time detection scenarios; and polynomial fitting optimization methods, which use high-order polynomial fitting to achieve error compensation. However, calculating high powers leads to numerous multiplication operations, resulting in long computation times, increased hardware malfunctions, and low equipment reliability.

[0003] Existing calculation and calibration methods for current sensing devices have not effectively solved the problems of temperature drift and nonlinear error superposition across the entire temperature range. The detection accuracy over a wide temperature range cannot meet the high-precision detection requirements of industry, especially in the high-temperature range (above 85°C), where the error increases exponentially. Furthermore, the calculation is time-consuming and cannot be adapted to the real-time data acquisition and reporting requirements of microcontrollers (MCUs). In the event of hardware failure, it can easily lead to equipment shutdown. Summary of the Invention

[0004] Objective: To address the above-mentioned shortcomings, this invention provides a current calibration method based on Horner's law that improves equipment operational reliability and reduces computation time. This invention also provides a current calibration system based on Horner's law.

[0005] Technical solution: To solve the above problems, the present invention provides a current calibration method based on Horner's law, comprising the following steps:

[0006] The current sensing device measures the current of the test component at different temperatures through the calibration module, obtains several measurement values ​​at different temperatures, and collects several corresponding standard current values ​​through the standard source meter;

[0007] The measured values, standard current values, and temperature are fitted using the least squares method to obtain a fitted high-order polynomial. Horner's rule is used to optimize the fitted high-order polynomial to obtain an optimized polynomial. The calibration coefficients of the optimized polynomial are converted into a standard format and written into the Flash storage area of ​​the microcontroller. The check value of the cyclic redundancy check algorithm is also generated and stored.

[0008] The system acquires the raw voltage and temperature values ​​detected by the current sensing device in real time and converts the acquired data into a standard format.

[0009] The calibration coefficients in the Flash storage area are read, and the integrity of the calibration coefficients is checked by the check value using the cyclic redundancy check algorithm.

[0010] After the verification is passed, the current value is calculated by using the optimized polynomial based on the calibration coefficients to obtain the calibrated current value from the standard format data.

[0011] Furthermore, if the calibration coefficient fails the integrity check, a degradation calculation is triggered, the current value is calculated using the degradation formula, and an error flag indicating that the coefficient is damaged is sent; the degradation formula is: I=V / R; where I is the current value, V is the original voltage value, and R is the nominal resistance value of the current sensing device.

[0012] Furthermore, the optimized polynomial is:

[0013] I calc =PT(T)*V+QT(T);

[0014] PT(T) = A0 + T(A1 + T(A2 + T*A3));

[0015] QT(T) = B0 + T(B1 + T(B2 + T*B3));

[0016] Among them, I calc PT(T) is the calibrated current value, QT(T) is the first temperature polynomial, V is the original voltage value, T is the temperature value, and A0, A1, A2, A3, B0, B1, B2, and B3 are calibration coefficients.

[0017] Furthermore, after the verification is passed, boundary processing is performed on the real-time temperature value: when the real-time temperature value is less than the lower limit of the temperature calibration, the current value is calculated based on the lower limit of the temperature calibration, and a temperature out-of-range warning sign is generated; when the real-time temperature value is greater than the upper limit of the temperature calibration, the current value is calculated based on the upper limit of the temperature calibration, and a temperature out-of-range warning sign is generated.

[0018] Furthermore, the different temperature settings range from -40℃ to 125℃, and at least 6 temperature calibration points are set, with at least 8 voltage measurement points set at each temperature calibration point.

[0019] Furthermore, the Flash storage area for storing calibration coefficients is a wide-temperature storage chip, and the storage area for calibration coefficients is an access-isolated area. It is writable in calibration mode and read-only in normal operation mode. The calibration mode is when the measured current value is fitted with a standard current value, and the normal operation mode is when the current value is calculated using the stored calibration coefficients.

[0020] Furthermore, the standard format is float single-precision floating-point data.

[0021] The current calibration system based on Horner's law described in this invention includes:

[0022] The experimental module is used to measure the current of the test component at different temperatures by using the current detection device through the calibration module, obtain several measurement values ​​at different temperatures, and collect several corresponding standard current values ​​through the standard source meter;

[0023] The calibration module is used to fit the measured values, standard current values, and temperature using the least squares method to obtain a fitted high-order polynomial; the Horner rule is used to optimize the fitted high-order polynomial to obtain an optimized polynomial; the calibration coefficients of the optimized polynomial are converted into a standard format and written to the Flash storage area of ​​the microcontroller; and the verification values ​​of the cyclic redundancy check algorithm are generated and stored.

[0024] The data acquisition module is used to acquire the raw voltage and temperature values ​​detected by the current detection device in real time and convert the acquired data into a standard format.

[0025] The verification module is used to read the calibration coefficients in the Flash storage area and use the cyclic redundancy check algorithm to perform integrity verification on the calibration coefficients through the verification value;

[0026] The output module is used to calculate the calibrated current value by using a polynomial optimized based on calibration coefficients to process the standard format data after the verification is passed.

[0027] Beneficial Effects: Compared with existing technologies, the significant advantage of this invention is that it uses Horner's rule to optimize polynomial calculations, reducing the number of multiplication operations through nested decomposition, achieving microsecond-level current calculations, and meeting the real-time detection requirements of MCUs. By incorporating temperature as a variable into the current calculation using a bivariate cubic polynomial, it achieves dual compensation for temperature drift and nonlinear errors over a wide temperature range of -40~125℃, especially solving the problem of error surge in the high-temperature range (above 85℃). The current detection accuracy is improved to within 0.1% across the entire temperature range, far superior to traditional linear calculation methods and simplified temperature compensation methods. A calibration coefficient verification step is set up for graded anomaly handling. When the calibration coefficient is damaged, the calculation method is switched to avoid equipment downtime due to coefficient damage, thus improving the reliability of equipment operation. Boundary truncation calculation is performed when the temperature exceeds the -40~125℃ boundary to ensure the availability of basic functions, significantly improving the operational reliability of the equipment in complex industrial wide-temperature environments. The algorithm is adapted to the hardware architecture of miniaturized intelligent calibration modules, compatible with floating-point processing unit (FPU) acceleration, balancing computational accuracy and hardware resource utilization, and consuming minimal Flash storage resources. Furthermore, it utilizes general-purpose wide-temperature hardware components to further control costs. The algorithm logic is simple and can be implemented using a general-purpose 32-bit wide-temperature MCU (supporting FPU), requiring no customized hardware. It can be directly ported to various current detection intelligent calibration devices, adapting to high-precision current detection scenarios in industrial measurement and control, new energy, and other applications with a wide temperature range of -40~125℃, possessing broad industrial application value. Attached Figure Description

[0028] Figure 1 This is a flowchart illustrating the calibration method in this invention.

[0029] Figure 2 This is a schematic diagram of the Horner's rule optimization calculation process in this invention.

[0030] Figure 3 This is a schematic diagram of the exception handling mechanism in this invention. Detailed Implementation

[0031] like Figure 1 As shown, this embodiment presents a current calibration method based on Horner's law, which includes the following steps:

[0032] Step 1: Real-time acquisition of the original voltage value V and real-time temperature value T of the current sensing device, and conversion of the original voltage value V and real-time temperature value T into the standard format of float single-precision floating-point data.

[0033] Step 2: Read the 8 floating-point calibration coefficients pre-stored in the Flash memory area and perform integrity verification on the calibration coefficients using the CRC32 cyclic redundancy check algorithm.

[0034] The calibration coefficients are obtained by calibration fitting at different temperatures. The specific steps are as follows:

[0035] In this embodiment, taking the full temperature range of -40~125℃ as an example, the current sensing device is connected to the intelligent calibration module and placed in a temperature chamber. The current of the test component is measured at six temperature points: -40℃, 0℃, 25℃, 85℃, 105℃, and 125℃. At least eight voltage detection points are set at each temperature point to obtain the current measurement value of the current sensing device at each voltage detection point at each temperature point. The standard current value of each voltage detection point at each temperature point is collected through a standard source meter.

[0036] The host computer uses the least squares method to fit the collected current measurement values, temperature values, and standard current values ​​to obtain a high-order polynomial for fitting; such as Figure 2 As shown, Horner's rule is used to optimize the fitted high-order polynomial, resulting in the optimized polynomial:

[0037] I calc =PT(T)*V+QT(T);

[0038] PT(T) = A0 + T(A1 + T(A2 + T*A3));

[0039] QT(T) = B0 + T(B1 + T(B2 + T*B3));

[0040] Among them, I calc The calibrated current value represents the final reported effective current data; PT(T) is the first temperature polynomial; QT(T) is the second temperature polynomial; V is the original voltage value of the current sensing device obtained through a high-precision acquisition interface; T is the temperature value, i.e., the real-time ambient temperature of the current sensing device, covering a range of -40~125℃; A0, A1, A2, A3, B0, B1, B2, and B3 are calibration coefficients. By incorporating temperature T as a variable into the polynomial, dual compensation for temperature drift and nonlinearity error over a wide temperature range of -40~125℃ is achieved. The decomposed first and second temperature polynomials require only 6 multiplication operations, replacing the 9 multiplication operations of direct calculation. Combined with FPU floating-point acceleration, the time for a single current calculation is less than 2μs, meeting the industrial requirements for real-time data acquisition and reporting.

[0041] The optimized polynomial calibration coefficients are converted into a standard format and written to the Flash memory of the microcontroller. In this embodiment, eight bivariate cubic polynomial calibration coefficients suitable for a wide temperature range of -40 to 125°C are obtained. The host computer sends the eight calibration coefficients to the intelligent calibration module. The microcontroller (MCU) of the intelligent calibration module writes the coefficients to the calibration coefficient area of ​​the Flash memory and calculates the check value of the calibration coefficients using the CRC32 cyclic redundancy check algorithm. The check value is stored at an address adjacent to the calibration coefficient. The Flash memory storing the calibration coefficients is a wide-temperature storage chip. The storage area used for the calibration coefficients is a permission-isolated area. It is writable in calibration mode and read-only in normal operation mode. Calibration mode is used when fitting the measured current value to the standard current value, and normal operation mode is used when calculating the current value using the stored calibration coefficients, to prevent the calibration coefficients from being maliciously tampered with.

[0042] like Figure 3 As shown, to prevent data anomalies in the calibration coefficients due to factors such as Flash damage or electromagnetic interference, the integrity of the calibration coefficients is verified using the CRC32 cyclic redundancy check algorithm. The specific steps are as follows:

[0043] Before each power-on or current calculation by reading the calibration coefficients, the microcontroller (MCU) recalculates the CRC32 check value of the calibration coefficients and compares it with the stored check value. If they match, the calibration coefficients are considered complete and the verification passes; if they do not match, the calibration coefficients are considered damaged and the verification fails.

[0044] Step 3: If the verification passes, boundary processing is performed on the real-time acquired temperature value. In this embodiment, the temperature range is set to -40~125℃. When the real-time acquired temperature value is less than the lower limit of the temperature calibration, the current value is calculated based on the lower limit of the temperature calibration (i.e., below -40℃ is truncated to -40℃), and a temperature out-of-range warning flag is generated. When the real-time acquired temperature value is greater than the upper limit of the temperature calibration, the current value is calculated based on the upper limit of the temperature calibration (i.e., above 125℃ is truncated to 125℃), and a temperature out-of-range warning flag is generated. After the calculation is completed, the temperature out-of-range warning flag is reported to the user without interrupting the current calculation and data reporting; only a notification is given that the current accuracy may be affected.

[0045] After boundary processing, the temperature value is used to calculate the values ​​of the first and second temperature polynomials based on Horner's rule and the stored calibration coefficients. The calibrated current value is then calculated based on the values ​​of the first and second temperature polynomials. After completion, the calibrated current value is converted into a numerical format that conforms to the communication protocol for subsequent data reporting.

[0046] If the verification fails, a degradation calculation is triggered, automatically switching to the traditional linear calculation method. The degradation formula is used to calculate the current value, ensuring the basic current calculation function remains usable. The degradation formula is: I = V / R; where I is the current value, V is the original voltage value, and R is the nominal resistance of the current sensing device. An error flag indicating a damaged coefficient is also sent, displayed via hardware indicator lights, reminding staff to repair it promptly.

Claims

1. A current calibration method based on Horner's law, characterized in that, Includes the following steps: The current sensing device measures the current of the test component at different temperatures through the calibration module, obtains several measurement values ​​at different temperatures, and collects several corresponding standard current values ​​through the standard source meter; The measured values, standard current values, and temperature are fitted using the least squares method to obtain a fitted high-order polynomial. Horner's rule is used to optimize the fitted high-order polynomial to obtain an optimized polynomial. The calibration coefficients of the optimized polynomial are converted into a standard format and written into the Flash storage area of ​​the microcontroller. The check value of the cyclic redundancy check algorithm is also generated and stored. The system acquires the raw voltage and temperature values ​​detected by the current sensing device in real time and converts the acquired data into a standard format. The calibration coefficients in the Flash storage area are read, and the integrity of the calibration coefficients is checked by the check value using the cyclic redundancy check algorithm. After the verification is passed, the current value is calculated by using the optimized polynomial based on the calibration coefficients to obtain the calibrated current value from the standard format data.

2. The current calibration method based on Horner's law according to claim 1, characterized in that, If the calibration coefficient fails the integrity check, a degradation calculation is triggered. The degradation formula is used to calculate the current value, and an error flag indicating that the coefficient is damaged is sent. The degradation formula is: I=V / R; where I is the current value, V is the original voltage value, and R is the nominal resistance value of the current sensing device.

3. The current calibration method based on Horner's law according to claim 1, characterized in that, The optimized polynomial is: I calc =PT(T)*V+QT(T); PT(T) = A0 + T(A1 + T(A2 + T*A3)); QT(T) = B0 + T(B1 + T(B2 + T*B3)); Among them, I calc PT(T) is the calibrated current value, QT(T) is the first temperature polynomial, V is the original voltage value, T is the temperature value, and A0, A1, A2, A3, B0, B1, B2, and B3 are calibration coefficients.

4. The current calibration method based on Horner's law according to claim 1, characterized in that, After verification, boundary processing is performed on the real-time temperature value: when the real-time temperature value is less than the lower limit of the temperature calibration, the current value is calculated based on the lower limit of the temperature calibration, and a temperature out-of-range warning sign is generated; when the real-time temperature value is greater than the upper limit of the temperature calibration, the current value is calculated based on the upper limit of the temperature calibration, and a temperature out-of-range warning sign is generated.

5. The current calibration method based on Horner's law according to claim 1, characterized in that, The different temperature settings range from -40℃ to 125℃, and at least 6 temperature calibration points are set, with at least 8 voltage measurement points set at each temperature calibration point.

6. The current calibration method based on Horner's law according to claim 1, characterized in that, The Flash storage area for storing calibration coefficients is a wide-temperature storage chip. The storage area for calibration coefficients is an access-isolated area, which is writable in calibration mode and read-only in normal operation mode. The calibration mode is when the measured current value is fitted with a standard current value, and the normal operation mode is when the current value is calculated using the stored calibration coefficients.

7. The current calibration method based on Horner's law according to claim 1, characterized in that, The standard format is float single-precision floating-point data.

8. A current calibration system based on Horner's law, characterized in that, include: The experimental module is used to measure the current of the test component at different temperatures by using the current detection device through the calibration module, obtain several measurement values ​​at different temperatures, and collect several corresponding standard current values ​​through the standard source meter; The calibration module is used to fit the measured values, standard current values, and temperature using the least squares method to obtain a fitted high-order polynomial; the Horner rule is used to optimize the fitted high-order polynomial to obtain an optimized polynomial; the calibration coefficients of the optimized polynomial are converted into a standard format and written to the Flash storage area of ​​the microcontroller; and the verification values ​​of the cyclic redundancy check algorithm are generated and stored. The data acquisition module is used to acquire the raw voltage and temperature values ​​detected by the current detection device in real time and convert the acquired data into a standard format. The verification module is used to read the calibration coefficients in the Flash storage area and use the cyclic redundancy check algorithm to perform integrity verification on the calibration coefficients through the verification value; The output module is used to calculate the calibrated current value by using a polynomial optimized based on calibration coefficients to process the standard format data after the verification is passed.

9. The current calibration system based on Horner's law according to claim 8, characterized in that, If the calibration coefficient fails the integrity check, the output module triggers a degradation calculation, calculates the current value using the degradation formula, and sends an error flag indicating that the coefficient is damaged. The degradation formula is: I=V / R; where I is the current value, V is the original voltage value, and R is the nominal resistance value of the current sensing device.

10. The current calibration method based on Horner's law according to claim 8, characterized in that, The optimized polynomial is: I calc =PT(T)*V+QT(T); PT(T) = A0 + T(A1 + T(A2 + T*A3)); QT(T) = B0 + T(B1 + T(B2 + T*B3)); Among them, I calc PT(T) is the calibrated current value, QT(T) is the first temperature polynomial, V is the original voltage value, T is the temperature value, and A0, A1, A2, A3, B0, B1, B2, and B3 are calibration coefficients.