Temperature compensation method of TMR current sensor
By measuring and fitting the temperature data of the TMR sensor, a mathematical model is generated and the temperature compensation coefficient is calculated, and the temperature compensation coefficient is performed in real time, the problems of poor universality and limited accuracy of the hardware compensation method are solved, and the temperature stability and measurement accuracy of the TMR current sensor are improved. sex.
Patent Information
- Application Number
- CN202410783746.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-11-01
AI Technical Summary
The existing hardware compensation method is suitable for analog sensors, with poor versatility, complex circuit design and limited accuracy, making it difficult to effectively solve the temperature impact problem of TMR current sensors.
By measuring the output voltage and sensitivity of the TMR sensor at multiple temperature points, a mathematical model is generated using a data fitting algorithm, the theoretical sensitivity and temperature compensation coefficient are calculated, the temperature is monitored in real time and compensation operations are performed to eliminate the impact of temperature on current measurement.
Automatic temperature drift compensation for TMR current sensor is achieved, which improves the accuracy and reliability of current measurement, simplifies circuit design, and avoids the increase in additional hardware.
Smart Images

Figure CN118884040A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of temperature compensation, and in particular to a temperature compensation method for a TMR current sensor. Background Art
[0002] Driven by the digital age, the power industry is undergoing a profound transformation, and the power grid system is developing towards a smart grid as the core. Smart grids use efficient two-way communication networks, advanced sensor measurement technology, innovative equipment technology, advanced control methods and decision support system technology to improve the reliability, safety, economy and efficiency of the power grid, while also focusing on environmental protection and safety of use. In smart grids, current is a key state parameter that must be accurately and real-time monitored. A variety of current sensor technologies are widely used in power systems to meet this demand, including traditional current transformers, Rogowski coils, shunts, and sensors based on magnetic effects such as fluxgates, Hall effect sensors and magnetoresistive sensors. Magnetoresistive sensors, especially those based on the tunneling magnetoresistive (TMR) effect, have become one of the key technologies for smart grids due to their high sensitivity to broadband magnetic fields, small size, good temperature stability, simple structure and low-cost production. These sensors can monitor a wider frequency range than current transformers, are smaller and more sensitive than Hall elements, and have a simpler structure and lower cost than fiber optic current sensors and fluxgate sensors. With the deepening of research on the TMR effect, TMR-based current sensors have become one of the focuses of power grid technology development, and have shown strong competitiveness and broad application prospects. Summary of the invention
[0003] In view of the problems existing in the existing hardware compensation method, the present invention is proposed.
[0004] Therefore, the problem to be solved by the present invention is that the method of hardware compensation is applicable to analog sensors, has poor versatility, complex circuit design and limited accuracy.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0006] In a first aspect, an embodiment of the present invention provides a temperature compensation method for a TMR current sensor, which includes:
[0007] Measure and obtain the output voltage and corresponding sensitivity of the TMR sensor at multiple temperature points;
[0008] Based on the measurement data of multiple temperature points, a mathematical model describing the relationship between sensor sensitivity and temperature is generated using a data fitting algorithm;
[0009] According to the mathematical model, calculating the theoretical sensitivity of the TMR sensor, and comparing the theoretical sensitivity with a reference sensitivity to obtain a temperature compensation coefficient;
[0010] The operating temperature of the TMR sensor is monitored in real time, the corresponding temperature compensation coefficient is found, and the original output voltage is calculated with the corresponding temperature compensation coefficient to obtain the current measurement value after temperature compensation.
[0011] As a preferred solution of the temperature compensation method of the TMR current sensor of the present invention, the sensitivity of the TMR sensor at multiple temperature points is obtained, and the sensitivity is preprocessed to eliminate the influence of its own voltage and temperature, as shown in the following formula:
[0012]
[0013] Among them, ΔV is the output voltage change, ΔV0 is the bias output voltage when I=0, which is used to eliminate the bias error, ΔI is the input current change, a is the temperature coefficient, which describes the degree of influence of sensitivity change with temperature, and ΔT is the temperature difference between the operating temperature and the reference temperature.
[0014] As a preferred solution of the temperature compensation method of the TMR current sensor of the present invention, the mathematical model uses a polynomial method to describe the temperature and sensitivity, as shown in the following formula:
[0015]
[0016] Among them, a1 is the cubic term coefficient, β1 is the quadratic term coefficient, γ1 is the linear term coefficient, δ1 is the constant term, λ1 is the overall weight coefficient of the third term, k1 controls the exponential decay rate, ε1 controls the denominator quadratic term coefficient, affects the curve shape, and T is time.
[0017] As a preferred solution of the temperature compensation method of the TMR current sensor of the present invention, wherein: calculating the temperature compensation coefficient includes:
[0018] Select a certain number of temperature points;
[0019] Substituting the temperature point into the mathematical model to calculate the theoretical sensitivity;
[0020] Select a reference temperature and substitute it into the mathematical model to calculate the reference sensitivity;
[0021] A temperature compensation coefficient is calculated according to the theoretical sensitivity and the reference sensitivity.
[0022] As a preferred solution of the temperature compensation method of the TMR current sensor of the present invention, wherein: calculating the current measurement value after temperature compensation includes:
[0023] Eliminate self-bias voltage;
[0024] Correction of temperature drift;
[0025] Eliminate the influence of temperature on current;
[0026] Corrects non-linear distortion.
[0027] As a preferred solution of the temperature compensation method of the TMR current sensor of the present invention, the elimination of the influence of temperature on current is shown in the following formula:
[0028]
[0029] Where C(T) is the temperature compensation coefficient, a is the voltage-to-current conversion coefficient, V0 is the bias voltage, β is the temperature compensation coefficient, γ, σ, C0 controls the shape and position of the Gaussian function, and δ is the proportionality coefficient.
[0030] As a preferred solution of the temperature compensation method of the TMR current sensor of the present invention, wherein: searching the corresponding temperature compensation coefficient includes:
[0031] Initialize the TMR sensor system, load the compensation coefficient lookup table data, start the temperature sensor data sampling, read the temperature value T in real time at a certain frequency, preprocess the read temperature value T, obtain reliable real-time temperature input, and find the key-value pair (T', C(T')) with the smallest difference with the current temperature T in the compensation coefficient lookup table. If there is no completely matching T in the lookup table, use the interpolation method to calculate the approximate value of C(T), and obtain the corresponding compensation coefficient C(T) or C(T') from the lookup table.
[0032] In a second aspect, an embodiment of the present invention provides a temperature compensation system for a TMR current sensor, comprising:
[0033] The sensor test module is used to test the performance of the TMR sensor at different temperature points and obtain the output voltage value and sensitivity data of the sensor;
[0034] A data fitting module, used for generating a mathematical model describing the relationship between sensor sensitivity and temperature using a data fitting algorithm according to sensor test data;
[0035] A sensitivity calculation module is used to calculate the theoretical sensitivity value of the TMR sensor at any operating temperature according to a mathematical model, compare the theoretical sensitivity value with the sensitivity value at a reference temperature, and obtain a temperature compensation coefficient;
[0036] The compensation calculation module calculates the original output voltage value of the TMR sensor and the temperature compensation coefficient to obtain the accurate current measurement value after temperature compensation.
[0037] In a third aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein: when the processor executes the computer program, any step of the temperature compensation method of the TMR current sensor is implemented.
[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the temperature compensation method of the TMR current sensor described above is implemented.
[0039] The beneficial effect of the present invention is that by real-time monitoring of the operating temperature of the TMR sensor, finding the corresponding temperature compensation coefficient, and performing compensation calculation on the original output of the sensor, the influence of temperature change on the sensitivity of the sensor can be effectively eliminated, thereby improving the accuracy and reliability of current measurement. The mathematical model in the invention scheme can describe the nonlinear relationship between the sensitivity and temperature in the entire operating temperature range of the sensor, and calculate the compensation coefficient at any temperature point based on the model, so that the automatic temperature drift compensation of the sensor in the entire temperature range can be realized. The scheme has no special restrictions on the construction of the model and the compensation algorithm, and different fitting algorithms, optimization objective functions and compensation formulas can be selected according to actual conditions, and it has strong flexibility and scalability. The temperature compensation method proposed in the invention scheme has clear steps and a simple compensation calculation formula. It can be easily implemented in embedded systems such as microcontrollers or digital signal processors using software algorithms without adding additional hardware circuits. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0041] Figure 1 The flow chart of establishing the temperature compensation model for the temperature compensation method of the TMR current sensor.
[0042] Figure 2 The TMR Wheatstone full bridge circuit diagram for the temperature compensation method of the TMR current sensor.
[0043] Figure 3 The temperature compensation structure block diagram of the temperature compensation method of the TMR current sensor. DETAILED DESCRIPTION
[0044] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0045] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0046] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0047] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0048] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0049] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0050] Example 1
[0051] Reference Figure 1 and Figure 2, which is the first embodiment of the present invention, provides a temperature compensation method for a TMR current sensor, comprising:
[0052] TMR current sensors utilize the Biot-Savart Law, which describes the relationship between the magnetic field generated by a steady current and the current. When a current flows through a conductor, a magnetic field is generated around it, the strength of which is proportional to the current and the direction follows the right-hand rule. The core of the TMR sensor is one or more TMR elements, whose resistance values change with the change of the magnetic field passing near them. Within a certain linear range, the resistance change of the TMR element is proportional to the strength of the magnetic field. By forming a Wheatstone bridge circuit with TMR elements, tiny resistance changes can be measured more accurately, thereby detecting the current passing through the wire. In a TMR current sensor, the resistance elements of one or more bridge arms are replaced by TMR elements. When the TMR element experiences a change in the magnetic field, the balance of the bridge circuit is broken, generating a voltage difference, which can be electronically measured and amplified to obtain an output signal proportional to the current passing through the wire. By measuring this voltage difference, the current intensity in the wire can be inferred.
[0053] However, the output of the TMR sensor is strongly dependent on temperature because temperature can affect the properties of the magnetic material, thereby changing the sensitivity and bias of the sensor. Under constant voltage, the tunneling magnetoresistance value can be expressed by the following formula based on the quadratic function relationship between tunnel current and temperature:
[0054]
[0055] It can be seen that as the temperature increases, the tunnel magnetoresistance decreases, and the temperature dependence of the magnetic tunnel junction resistance is a negative temperature coefficient. Without considering the influence of temperature changes, the output of the TMR bridge in the presence of an external magnetic field can be expressed as:
[0056]
[0057] When the TMR sensitive structure is affected by temperature changes, R and ΔR will change with temperature, and the changes are represented by RT and ΔRT respectively. At this time, the output of the TMR bridge can be expressed as:
[0058]
[0059] It can be seen that when measuring the same magnetic field, the output voltage of the TMR sensitive structure will change due to temperature changes, which is specifically manifested as temperature drift of the sensor sensitivity.
[0060] The present invention provides a software temperature compensation scheme for a TMR current sensor. First, the performance of the TMR sensor at different temperatures needs to be tested to determine how temperature affects the response of the sensor. The test should cover the temperature range in which the sensor is expected to work. The output of the sensor is measured at different temperature points, and the sensitivity of the sensor is calculated. Based on the test data at multiple temperature points, a sensitivity-temperature curve or model can be generated using a data fitting algorithm, which describes the relationship between the sensor sensitivity and temperature.
[0061] For example, in one possible embodiment, the relationship between sensor sensitivity and temperature is tested and plotted as follows:
[0062] Prepare a thermostat or temperature-controlled test chamber where you can accurately set and maintain different temperature points. Fix the TMR sensor to be tested in the test device and connect the circuit. Set the test environment to the first preset temperature point and wait until the temperature inside and outside the sensor is completely stable before starting the test.
[0063] Use a high-precision standard current source to stimulate the sensor under test, provide different known current values, measure the output voltage value of the sensor at each current point, calculate the sensitivity, change the test environment temperature to the next preset point, and further, continuously change the temperature point to cover the entire expected operating temperature range of the sensor. Record the output voltage and calculated sensitivity data corresponding to different current values at each temperature point.
[0064] Preferably, in general, the sensitivity calculation of the TMR sensor usually directly uses voltage in current, but it ignores the bias voltage of the TMR device itself, which will cause certain errors, and does not consider the influence of temperature. The accuracy is not high in the temperature compensation scenario, so the bias term, temperature difference and temperature coefficient are added to eliminate the influence of the voltage and temperature, as follows:
[0065]
[0066] Among them, ΔV is the output voltage change, ΔV0 is the bias output voltage when I=0, which is used to eliminate the bias error, ΔI is the input current change, a is the temperature coefficient, which describes the degree of influence of sensitivity change with temperature, and ΔT is the temperature difference between the operating temperature and the reference temperature.
[0067] Furthermore, based on the test data of multiple temperature points, a data fitting algorithm is used to generate a model representation of sensitivity and temperature. Through the large number of test data points obtained in the previous step, a mathematical model or curve between sensitivity and temperature is obtained using a data fitting method.
[0068] Sort the test data by temperature from low to high, and each temperature point corresponds to the sensitivity data of multiple current values. Take the average value as the representative sensitivity value of the temperature point.
[0069] Create a new two-dimensional coordinate system, with the horizontal axis representing temperature T and the vertical axis representing sensitivity S. Plot the prepared (T, S) data points in the coordinate system, observe the distribution of the data points, and determine whether it is a trend curve in the form of a linear, quadratic, exponential, or other function. And determine the function type that matches this trend.
[0070] Further, a corresponding fitting algorithm is selected to perform fitting calculation on the coordinate point data. In this embodiment, the fitting curve of the present invention is shown as follows:
[0071] Specifically, a polynomial method is used to describe temperature and sensitivity, where the cubic fractional polynomial term is used to fit the overall trend and basic shape of the data, as follows:
[0072] a1 3 +β1T 2
[0073] Among them, a1T 3 is the cubic term of the ST curve, capturing the steep and warped parts of the ST curve, β1T 2 is the quadratic term of the ST curve, capturing the parabolic shape of the ST curve.
[0074] Furthermore, the second term is a rational fraction that captures the extreme points and inflection points of the fitted data, as follows:
[0075]
[0076] Among them, γ1 is the coefficient of the linear term, δ1 is the coefficient of the constant term, and ε1 is the coefficient of the quadratic term that controls the denominator, which affects the shape of the curve.
[0077] Furthermore, the third item captures the dramatic change trend of the data near the critical temperature, as follows:
[0078] λ1exp(-k1·(T-T0) 2 )
[0079] Among them, λ1 is the overall weight coefficient, and k1 is the control exponential decay rate.
[0080] Finally, add the three items together to get a nonlinear function to describe the actual data point distribution of ST:
[0081]
[0082] Among them, a1 is the cubic term coefficient, β1 is the quadratic term coefficient, γ1 is the linear term coefficient, δ1 is the constant term, λ1 is the overall weight coefficient of the third term, k1 controls the exponential decay rate, and ε1 controls the denominator quadratic term coefficient, which affects the shape of the curve.
[0083] It should be noted that obtaining the coefficients of the fitting curve includes the following steps:
[0084] All coefficients are given initial values, which can be random values or approximate values given based on experience.
[0085] The optimization objective function is defined so that it can measure the fitting error between the formula and the actual data points under the current coefficient value. This embodiment minimizes the residual sum of squares:
[0086]
[0087] According to the characteristics of the objective function, an unconstrained optimization algorithm is selected. The selected algorithm is used to perform unconstrained optimization solution for the objective function. The algorithm iteratively adjusts the coefficient value so that the objective function value continues to decrease until the termination condition is reached. In this embodiment, the termination condition is to reach the maximum number of iterations and the minimum value of the objective function value.
[0088] After the optimization process is completed, the values of each coefficient at this time are output as the optimal solution, that is, the optimal value of each coefficient.
[0089] Furthermore, according to the above curve model, the corresponding theoretical sensitivity value of the TMR sensor at any operating temperature T is calculated. At the same time, the temperature compensation coefficient is defined as follows in this embodiment:
[0090]
[0091] Where T is any operating temperature, T ref As a reference temperature, we usually take its theoretical sensitivity value As a benchmark, then for any temperature T, we can calculate the corresponding temperature compensation coefficient C(T).
[0092] Specifically, determine the operating temperature range of the TMR sensor, select a certain number of temperature points within the range according to the required accuracy, and substitute each temperature point T into the formula to calculate Select a reference temperature T ref ,calculate For each T, C(T) is calculated according to the formula, and the resulting (T, C(T)) value pair is saved as the compensation coefficient for subsequent searches.
[0093] Considering the cost and measurement accuracy, an independent temperature sensor chip is soldered on the TMR sensor circuit board. The temperature sensor chip needs to be placed near the TMR sensor element to obtain the closest temperature signal. The temperature data is read from the chip through I2C, SPI or analog-to-digital conversion, and the read temperature data is filtered and processed to obtain real-time temperature monitoring output.
[0094] In the previous steps, the accurate temperature-compensation coefficient mapping relationship is obtained and stored in an efficient lookup table and other data structures. According to the instantaneous operating temperature of the TMR sensor, the correct temperature compensation coefficient is dynamically called. This dynamic search process can be efficiently implemented in the algorithm program in the form of interrupts or loop scanning, as shown below:
[0095] Initialize the TMR sensor system, load the compensation coefficient lookup table data, start the temperature sensor data sampling, read the temperature value T in real time at a certain frequency, filter and process the read temperature value T to obtain reliable real-time temperature input, and find the key-value pair (T', C(T')) closest to the current temperature T in the compensation coefficient lookup table. If there is no completely matching T in the lookup table, it is necessary to use interpolation and other methods to calculate the approximate value of C(T), obtain the corresponding compensation coefficient C(T) or C(T') from the lookup table, and pass the obtained compensation coefficient C(T) to the subsequent compensation operation module.
[0096] After obtaining the real-time temperature compensation coefficient C(T), it is necessary to combine it with the original output value of the TMR sensor to perform data compensation operation to obtain the true current measurement value that has been corrected for temperature drift. The compensation operation steps are as follows:
[0097] Read the original output voltage value V_out from the TMR sensor, read the original output voltage value V_out from the TMR sensor, and use the real-time temperature compensation coefficient C(T) obtained earlier to calculate the compensated current value.
[0098] Preferably, a correction term is introduced based on the most basic linear voltage-current conversion formula to eliminate the influence of the bias voltage. When the TMR sensor is actually working, there will be a certain bias voltage V0 in the output. By subtracting V0, the influence of this bias can be eliminated, thereby improving the calculation accuracy.
[0099] a(V out -V0)
[0100] Furthermore, since the output of the TMR sensor has obvious temperature dependence, temperature changes will affect its sensitivity and thus cause measurement deviation, so a temperature compensation coefficient is added to correct the temperature drift:
[0101] a(V out -V0)+βVout
[0102] Among them, β is the temperature compensation coefficient, which can effectively correct the sensitivity drift caused by temperature changes by multiplying it with the output voltage.
[0103] Furthermore, the effect of temperature on the compensation effect is usually nonlinear. The Gaussian function can more accurately describe this nonlinear relationship. When the temperature compensation coefficient C(T) is close to a certain value C0, the compensation effect is the best; when it is far away, the effect decreases:
[0104]
[0105] Furthermore, in addition to the output voltage, the original current value is also affected by temperature. Dividing it by the temperature compensation coefficient can further eliminate the influence of temperature on the current value, thereby improving the accuracy of current calculation:
[0106]
[0107] Furthermore, under high current working conditions, the TMR sensor may exhibit certain nonlinear characteristics. By subtracting a hypertangent function term, this nonlinear distortion can be better corrected so that the formula maintains linearity and accuracy over the entire range:
[0108]
[0109] Among them, a is the voltage-to-current conversion coefficient, V0 is the bias voltage; β is the temperature compensation coefficient, γ, σ, C0 control the shape and position of the Gaussian function, δ is the proportional coefficient, ε is the pre-coefficient of the hypertangent function, ζ controls the steepness of the hypertangent function, and I0 is the reference current value.
[0110] Through the above calculations, Icomp is obtained, which is the accurate current value after temperature drift compensation of the original output of the TMR sensor. It is output, stored or processed later as the final current measurement result of the TMR sensor system.
[0111] Specifically, the data is output to a digital interface in the form of a digital quantity, displayed on a display screen such as an LCD or LED, and stored in a memory or an external storage device for subsequent analysis.
[0112] Furthermore, this embodiment also provides a temperature compensation system for a TMR current sensor, comprising:
[0113] This embodiment also provides a computer device, which is applicable to the temperature compensation method of the TMR current sensor, and includes a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the temperature compensation method of the TMR current sensor proposed in the above embodiment.
[0114] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0115] This embodiment further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the temperature compensation method for a TMR current sensor as proposed in the above embodiment is implemented.
[0116] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0117] Example 2
[0118] Reference Figure 3 , which is the second embodiment of the present invention, and this embodiment provides a temperature compensation method for a TMR current sensor. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0119] In order to verify the effectiveness and advantages of the software temperature compensation solution for the TMR current sensor of the present invention, we conducted the following experimental tests.
[0120] First, a commercial TMR current sensor chip ALxxxxxx was selected, which has advantages such as a wide temperature measurement range (-40℃~125℃) and a high rated input current (up to ±15A). The chip was soldered to a dedicated circuit board and the required circuit was connected.
[0121] Secondly, a precision-grade constant temperature test chamber was prepared, with a temperature control accuracy of ±0.1°C. A high-precision standard current source instrument (6.5 digits) was placed inside the test chamber, which can provide a large current test excitation of up to 20A. In addition, a standard digital multimeter was prepared to read the output voltage of the TMR sensor under different current and temperature conditions with a measurement accuracy of 6.5 digits.
[0122] Next, the detailed process of the sensor performance test is as follows: Place the above test circuit board and instrument in a constant temperature box, first set the initial temperature to -40℃, wait for the internal and external temperatures to stabilize completely, turn on the current source instrument, and excite at six current points of 1A, 3A, 6A, 9A, 12A, and 15A, and use a multimeter to read the corresponding output voltage values. Record all test data.
[0123] Then, the temperature was gradually raised to -20°C, 0°C, 20°C, 40°C, 60°C, 80°C, 100°C and 125°C, and the above excitation and measurement process was repeated at each temperature point to obtain a corresponding set of test data. In the entire temperature range, a total of 64 sets of test data points under different temperature and current conditions were covered.
[0124] After that, for each temperature point, the output voltage values collected under different currents are linearly fitted to calculate the sensitivity value at that temperature point. Combining the sensitivity data of all temperature points, the sensitivity characteristics analysis of the TMR sensor in the entire temperature range can be completed.
[0125] Through the above detailed test process, a large amount of experimental data was obtained, as shown in the following table:
[0126] Table 1 Experimental data table
[0127]
[0128] From the above experimental data, it can be seen that the sensitivity of the TMR sensor shows obvious nonlinear characteristics as the temperature changes, and it is difficult for ordinary linear models to accurately describe this law. The trend of the data in the low temperature area is relatively gentle, and there is an obvious inflection point and rapid decline in the high temperature area. This is closely related to the physical properties of the TMR device itself, which shows that it is necessary and reasonable for us to establish a temperature-sensitivity model and perform real-time compensation.
[0129] As can be seen from the table above, in the temperature range of -40℃~125℃, the minimum compensation coefficient C(T) is 0.847 and the maximum is 1.136. This means that if the uncompensated measurement value is used directly, it will cause an error of 15.3% in the worst case! After using the software temperature compensation algorithm we proposed, this error is completely eliminated and the measurement accuracy is greatly improved.
[0130] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A temperature compensation method for a TMR current sensor, characterized in that: include, Measure and obtain the output voltage and corresponding sensitivity of the TMR sensor at multiple temperature points; Based on the measurement data of multiple temperature points, a mathematical model describing the relationship between sensor sensitivity and temperature is generated using a data fitting algorithm; According to the mathematical model, calculating the theoretical sensitivity of the TMR sensor, and comparing the theoretical sensitivity with a reference sensitivity to obtain a temperature compensation coefficient; The operating temperature of the TMR sensor is monitored in real time, the corresponding temperature compensation coefficient is found, and the original output voltage is calculated with the corresponding temperature compensation coefficient to obtain the current measurement value after temperature compensation.
2. The temperature compensation method of a TMR current sensor according to claim 1, characterized in that: After obtaining the sensitivity of the TMR sensor at multiple temperature points, the sensitivity is preprocessed to eliminate the influence of its own voltage and temperature, as shown in the following formula: Among them, ΔV is the output voltage change, ΔV0 is the bias output voltage when I=0, which is used to eliminate the bias error, ΔI is the input current change, a is the temperature coefficient, which describes the degree of influence of sensitivity change with temperature, and ΔT is the temperature difference between the operating temperature and the reference temperature.
3. The temperature compensation method of a TMR current sensor according to claim 1, characterized in that: The mathematical model uses a polynomial method to describe temperature and sensitivity, as shown in the following formula: Among them, a1 is the cubic term coefficient, β1 is the quadratic term coefficient, γ1 is the linear term coefficient, δ1 is the constant term, λ1 is the overall weight coefficient of the third term, k1 controls the exponential decay rate, ε1 controls the denominator quadratic term coefficient, affects the curve shape, and T is time.
4. The temperature compensation method of a TMR current sensor according to claim 1, characterized in that: Calculating the temperature compensation coefficient includes, Select a certain number of temperature points; Substituting the temperature point into the mathematical model to calculate the theoretical sensitivity; Select a reference temperature and substitute it into the mathematical model to calculate the reference sensitivity; A temperature compensation coefficient is calculated according to the theoretical sensitivity and the reference sensitivity.
5. The temperature compensation method of a TMR current sensor according to claim 1, characterized in that: Calculating the temperature compensated current measurement value includes, Eliminate self-bias voltage; Correction of temperature drift; Eliminate the influence of temperature on current; Corrects non-linear distortion.
6. The temperature compensation method of the TMR current sensor according to claim 5, characterized in that: The effect of the elimination temperature on the current is shown in the following formula: Where C(T) is the temperature compensation coefficient, a is the voltage-to-current conversion coefficient, V0 is the bias voltage, β is the temperature compensation coefficient, γ, σ, C0 controls the shape and position of the Gaussian function, and δ is the proportionality coefficient.
7. The temperature compensation method of a TMR current sensor according to claim 1 or 4, characterized in that: Finding the corresponding temperature compensation coefficient includes, Initialize the TMR sensor system, load the compensation coefficient lookup table data, start the temperature sensor data sampling, read the temperature value T in real time at a certain frequency, preprocess the read temperature value T, obtain reliable real-time temperature input, and find the key-value pair (T', C(T')) with the smallest difference with the current temperature T in the compensation coefficient lookup table. If there is no completely matching T in the lookup table, use the interpolation method to calculate the approximate value of C(T), and obtain the corresponding compensation coefficient C(T) or C(T') from the lookup table.
8. A temperature compensation system for a TMR current sensor, based on the temperature compensation method for a TMR current sensor according to any one of claims 1 to 7, characterized in that: include, The sensor test module is used to test the performance of the TMR sensor at different temperature points and obtain the output voltage value and sensitivity data of the sensor; A data fitting module, used for generating a mathematical model describing the relationship between sensor sensitivity and temperature using a data fitting algorithm according to sensor test data; A sensitivity calculation module is used to calculate the theoretical sensitivity value of the TMR sensor at any operating temperature according to a mathematical model, compare the theoretical sensitivity value with the sensitivity value at a reference temperature, and obtain a temperature compensation coefficient; The compensation operation module calculates the original output voltage value of the TMR sensor and the found temperature compensation coefficient to obtain an accurate current measurement value after temperature compensation.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the temperature compensation method for the TMR current sensor according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the temperature compensation method for a TMR current sensor according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Fluxgate sensor fault detection method
CN119310514A
A method for detecting faults in a fluxgate sensor
CN119310514B
Current sensor based on differential demodulation and PID feedback control and environment compensation method thereof
CN120177862A
Tunnel reluctance current sensor structure and temperature parameter optimization method and system
CN121208423A
Temperature drift compensation method and system based on double-loop TMR current sensor
CN122283229A
