CN112730963A - Automobile-level Hall current sensor with temperature compensation and compensation method thereof - Google Patents

Automobile-level Hall current sensor with temperature compensation and compensation method thereof Download PDF

Info

Publication number
CN112730963A
CN112730963A CN202011529153.7A CN202011529153A CN112730963A CN 112730963 A CN112730963 A CN 112730963A CN 202011529153 A CN202011529153 A CN 202011529153A CN 112730963 A CN112730963 A CN 112730963A
Authority
CN
China
Prior art keywords
current
temperature
value
sampling
task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011529153.7A
Other languages
Chinese (zh)
Inventor
刘玉正
唐新颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN202011529153.7A priority Critical patent/CN112730963A/en
Publication of CN112730963A publication Critical patent/CN112730963A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/25Arrangements for measuring currents or voltages or for indicating presence or sign thereof using digital measurement techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R15/00Details of measuring arrangements of the types provided for in groups G01R17/00 - G01R29/00, G01R33/00 - G01R33/26 or G01R35/00
    • G01R15/14Adaptations providing voltage or current isolation, e.g. for high-voltage or high-current networks
    • G01R15/20Adaptations providing voltage or current isolation, e.g. for high-voltage or high-current networks using galvano-magnetic devices, e.g. Hall-effect devices, i.e. measuring a magnetic field via the interaction between a current and a magnetic field, e.g. magneto resistive or Hall effect devices
    • G01R15/202Adaptations providing voltage or current isolation, e.g. for high-voltage or high-current networks using galvano-magnetic devices, e.g. Hall-effect devices, i.e. measuring a magnetic field via the interaction between a current and a magnetic field, e.g. magneto resistive or Hall effect devices using Hall-effect devices
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/32Compensating for temperature change

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measuring Instrument Details And Bridges, And Automatic Balancing Devices (AREA)
  • Measurement Of Current Or Voltage (AREA)

Abstract

An automobile-level Hall current sensor with temperature compensation and a compensation method thereof comprise a probe unit, a driving unit, a current sampling unit, a temperature sampling unit, a main control unit and an output unit; the driving unit is connected with the probe unit and used for driving a Hall element and a secondary compensation coil of the probe unit; the probe unit is connected with the main control unit through the current sampling unit and is used for collecting current to be measured of the probe unit; the temperature sampling unit is connected with the main control unit and is used for collecting the current working temperature; the main control unit calculates the current to be measured with temperature compensation according to the collected current to be measured and the working temperature; the output unit is a CAN bus interface, is connected with the main control unit and provides a communication interface for the sensor and other main control equipment. According to the temperature compensation method, a two-dimensional regression method fitting curve algorithm based on the least square method is adopted, so that the measurement error of the sensor caused by the change of the working temperature can be reduced by 1 order of magnitude.

Description

Automobile-level Hall current sensor with temperature compensation and compensation method thereof
Technical Field
The invention relates to the field of current sensors, in particular to an automobile-level Hall current sensor with temperature compensation and a temperature compensation method.
Background
The large current detection technology is widely applied to the fields of industrial automation, electric vehicles, power transmission, monitoring and maintenance of electrical equipment and the like. The common current detection technologies mainly include a resistive shunt method and a hall effect current detection method. The resistive shunt method is characterized in that a current value to be measured is calculated by measuring the voltage drop of a resistor carrying current (and charge) to be measured, wherein the voltage drop follows ohm's law (V ═ I × R), and the current value to be measured is carried by the voltage drop; the Hall effect current detection method is an 'electric-magnetic-electric' conversion measurement process by detecting a magnetic field around a conductor bearing current, has the advantages of wide measurement range, quick response, better linearity, high precision, isolation detection and the like, and is a method mainly used in the field of current large current detection.
The core component of the hall current sensor is a hall element, which is a semiconductor element. The hall element is manufactured by using three semiconductor materials of gallium arsenide (GaAs), indium antimonide (InSb) and indium arsenide (InAs), wherein the semiconductor materials are sensitive to temperature, and particularly, the input/output resistance and the sensitivity change along with the change of temperature, so that the output voltage drift phenomenon occurs, and the measurement accuracy and the reliability are influenced. Therefore, the temperature compensation problem is a key link for improving the performance of the sensor.
The temperature compensation of the Hall current sensor mainly comprises two modes of hardware compensation and software compensation. Hardware compensation, namely a constant voltage source and constant current source input end compensation method, wherein a driving signal which is opposite in phase to the temperature drift of the Hall current sensor is generated through a power supply input end of the sensor to eliminate the temperature drift; the synchronous output end compensation method of the thermistor is characterized in that the temperature of the environment is sensed by temperature sensitive elements such as the thermistor and the like, an output signal which is in phase or phase reversal with the Hall current sensor is generated, and the output signal and the output of the Hall current sensor are operated to eliminate temperature drift. The hardware compensation method has the defects of difficult debugging, low precision, high cost, poor consistency and the like, and is not beneficial to the batch production and popularization of products. The software compensation can be realized by means of a digital signal processing technology through simple operation of the MCU, and the defect of hardware compensation can be overcome.
At present, the software compensation method of the hall current sensor mainly comprises the following steps: table look-up method, neural network method, curve surface fitting method, least square polynomial fitting method and the like. The table lookup method needs to occupy a large memory space; the neural network method has the defects of unstable network, long training time, high cost and the like; the curve surface fitting method has complex operation, high resource requirement on the MCU and high cost, and the compensation methods are not suitable for the mass production of the Hall current sensor.
Disclosure of Invention
In order to solve the problems, the technical scheme of the invention provides an automobile-level Hall current sensor with temperature compensation, and provides a method for performing temperature compensation by using a two-dimensional regression method fitting curve algorithm based on a least square method.
In order to achieve the purpose, the technical scheme is as follows:
an automobile-level Hall current sensor with temperature compensation comprises a hardware part, a software part and a temperature compensation method part.
The hardware part mainly comprises a probe unit, a driving unit, a current sampling unit, a temperature sampling unit, a main control unit and an output unit.
The probe unit comprises an annular iron core, a secondary compensation coil wound on the annular iron core and a Hall element, and converts a primary side current Ip to a secondary side compensation coil current Is.
The driving unit is connected with the probe unit and used for providing a working constant voltage source for the Hall element and amplifying an output signal of the Hall element through a high-power operational amplifier to provide driving for the secondary compensation coil;
the current sampling unit comprises a reference voltage reference circuit, a current sampling circuit, a differential amplification circuit and an ADC (analog to digital converter) conversion circuit, Is connected with the driving unit, converts the current Is of the secondary compensation coil into a digital signal Di through current-voltage conversion, signal amplification conditioning and ADC conversion, and sends the digital signal Di to the MCU through the SPI bus;
the temperature sampling unit converts the working temperature into a digital signal Dt through an ADC (analog to digital converter), and sends the digital signal Dt to the main control unit MCU through an SPI (serial peripheral interface) bus;
the main control unit calculates the current to be measured Ipt with the temperature compensation band according to the sampled current data Dt and the working temperature data Dt;
the output unit provides a CAN communication interface for outputting the measurement current Ipt, and provides reliable hardware support for establishing communication between the main control unit and the CAN host.
The software part mainly comprises a system initialization task, a current sampling task, a temperature sampling task, a data processing task, a CAN bus communication task and an idle task.
The system initialization task is mainly used for completing the bottom layer drive initialization of modules such as a system clock, a timer, a debugging serial port, a watchdog, an SPI bus, a CAN bus and the like, and entering the idle task after the bottom layer drive initialization is completed.
And the current sampling task is triggered and started once every 2ms, current data Di are sampled for 32 times continuously, filtering is carried out by a median average method, the data are stored in a cache, and the idle task is started after the data are stored in the cache.
And the temperature sampling task is triggered and started once every 20ms, temperature data Dt is sampled for 15 times continuously, filtering is carried out by a median average method, the data is stored in a cache, and the idle task is started after the data is stored in the cache.
The data processing task introduces the AD value Di of the current sampling and the AD value Dt of the temperature sampling into a mathematical function of the value of the Hall current sensor to be measured with temperature compensation to calculate the current I to be measuredptAnd storing the data into a cache, and entering the idle task after the data is finished.
And the CAN communication task is triggered and started once every 10ms, the measured current data is sent to the main control equipment on the CAN bus in a CAN message mode, and after the CAN communication task is completed, an idle task (406) is started.
The idle task has a task scheduling function, enters a corresponding task after detecting that the triggering conditions of a current sampling task (402), a temperature sampling task (403) or a CAN communication task are met, and waits for the meeting of the triggering conditions if the triggering of the task is not detected.
The invention relates to an automobile-level Hall current sensor with temperature compensation and a compensation method thereof, wherein the method comprises the following implementation steps of:
s1, electrifying the system, initializing each module of software and hardware and starting the operation;
and S2, the driving unit amplifies the output signal of the Hall element of the probe unit through the high-power operational amplifier to drive the secondary compensation coil, and converts the current Ip of the primary side coil into the current Is of the secondary side compensation coil according to the principle of the closed-loop current sensor.
And S3, converting the current Is measured by the secondary compensation coil in the step S2 into a measured voltage Us through a sampling resistor RS by a current sampling unit, converting the measured voltage Us into a measured voltage Um after amplification and conditioning by a differential amplifier circuit, converting the measured voltage Um into a digital signal Di through an ADC (analog to digital converter) conversion circuit, and transmitting the digital signal Di to the MCU (micro control unit) through the SPI (serial peripheral interface) bus.
And S4, converting the working environment temperature into a measurement voltage Ut by the temperature sampling unit, converting the measurement voltage Ut into a digital signal Dt through the ADC conversion circuit, and transmitting the digital signal Dt to the MCU through the SPI bus.
S5, the main control unit MCU substitutes the current value Di sampled in the step S3 and the working temperature value Dt sampled in the step S4 into a current measurement temperature compensation function I of a two-dimensional regression method fitting curve algorithm based on a least square methodpt=a0+a1DI+a2Dt+a3DI 2+a4DIDt+a5Dt 2+ ξ, the measurement current Ipt with temperature compensation is calculated.
S6, the master control unit sends the measured data to the CAN on-line host device through the output unit CAN bus, and repeats the steps S3-S6.
The temperature compensation method is a two-dimensional regression method fitting curve algorithm based on a least square method. Function models of the current to be measured Ipt with temperature compensation, the ADC value Di of the sampling current and the temperature Dt value of the sampling working environment are as follows:
Ipt=f(DI,Dt);
the two-dimensional regression mathematical model is:
Ipt=a0+a1DI+a2Dt+a3DI 2+a4DIDt+a5Dt 2
where ξ is the high order infinitesimal, Di is the ADC value of the current sample, Dt is the ADC value of the ambient temperature sample, and α 0, α 01, α 12, α 23, α 4, and α 5 are constants. Therefore, the values of the constants alpha 0, alpha 1, alpha 2, alpha 3, alpha 4 and alpha 5 are determined, and the complete current value I to be measured of the Hall current sensor with temperature compensation can be obtainedptThe mathematical function of (2), comprising the steps of:
step one, placing a current sensor into a thermostat device, setting a temperature value T1, and starting measurement after the temperature is constant;
sampling a temperature ADC value Dt;
sequentially sampling current sampling values Di under n standard measurement currents In;
and step four, sequentially setting m temperatures of T2-Tm, repeating the step two to the step three, and sampling m temperature sampling ADC values Dt and m multiplied by n uncompensated current sampling ADC values Di.
Step five, using a least square method to input a current sampling value Di, a temperature sampling value Dt and an input calibration standard value InThe fit is made according to the least squares principle that the root mean square R should be minimal:
Figure BDA0002851571500000051
mean square error R is a0~a5According to the multiple functions, the extreme value condition is solved, let a0~a5Each partial derivative of (a) is 0 to obtain six linear equations, arranging the six-element linear equations, and solving to obtain a constant a0~a5
Step six, constant a is added0~a5Substituted into the current temperature to be measuredCompensating the two-dimensional regression mathematical model to obtain a complete current value I to be measured of the Hall current sensor with temperature compensationptIs used as a mathematical function of (2).
And step seven, solidifying the mathematical function in the MCU program, sampling the current sampling value Di and the temperature AD value Dt every time, and calculating the current value to be measured of the Hall sensor with temperature compensation.
The application has the beneficial effects that:
according to the invention, the measurement accuracy and the linearity of the Hall current sensor are improved through temperature compensation, the measurement accuracy can be improved by 1 order of magnitude before compensation, and the detection effect is prevented from being influenced by temperature.
The temperature compensation of the invention is realized by adopting a software algorithm, a least square fitting method and a two-dimensional regression fitting curve mathematical algorithm are applied, and the temperature compensation is realized by software, so that the temperature compensation is stable and reliable, and the cost of products is not required to be additionally increased.
The invention amplifies and samples small signals, adopts differential amplification and sampling on hardware, and reduces interference introduced by components and circuits.
The analog-to-digital conversion adopts 16-bit high-resolution ADC, the measurement resolution is high, and the current of 0 to +/-1000A can be measured; and software filtering is carried out on the sampled data, so that the measurement error caused by accidental interference is avoided.
The invention adopts key components such as the MCU main controller, the CAN bus transceiver and the like to adopt high-reliability automobile-level chips, supports 500K and 250K baud rates, and is particularly suitable for occasions with high-reliability application environment requirements such as electric automobiles and the like.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below.
FIG. 1 is a first schematic flow chart diagram according to an embodiment of the present invention;
FIG. 2 is a flow diagram illustrating a second embodiment of the present invention;
FIG. 3 is a first diagram illustrating a hardware configuration according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a second hardware configuration according to an embodiment of the present invention;
FIG. 5 is a software architecture diagram of an embodiment of the present invention;
FIG. 6 is a table of uncompensated measured current AD values for an embodiment of the present invention;
FIG. 7 is a table of uncompensated current measurements for an embodiment of the present invention;
FIG. 8 is a table of compensated current measurements for an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects solved by the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1 to 8, a temperature compensation system of a car-level hall current sensor and a compensation method thereof includes the following steps;
s1, electrifying the system, initializing each module of software and hardware and starting the operation;
s2, the driving unit 302 amplifies the output signal of the hall element 309 of the probe unit 301 by the high power operational amplifier to provide a drive for the secondary compensation coil 308, and converts the primary coil current Ip into the secondary compensation coil current Is according to the principle of the closed-loop current sensor.
S3, the current sampling unit 303 converts the current Is measured by the secondary compensation coil in the step S2 into a measurement voltage Us through a sampling resistor RS, the measurement voltage Us Is amplified and conditioned through a differential amplifier circuit and then converted into a measurement voltage Um, the measurement voltage Um Is converted into a digital signal Di through an ADC (analog to digital converter) circuit, and the digital signal Di Is sent to the main control unit 305MCU through the SPI bus.
S4, the temperature sampling unit 304 converts the temperature of the working environment into a measurement voltage Ut, the measurement voltage Ut is converted into a digital signal Dt by the ADC conversion circuit, and the digital signal Dt is sent to the main control unit 303MCU through the SPI bus.
S5, the main control unit 305MCU brings the current value Di sampled in the step S3 and the working temperature value Dt sampled in the step S4 into a two-dimensional regression based on the least square methodCurrent measurement temperature compensation function I of regression fitting curve algorithmpt=a0+a1DI+a2Dt+a3DI 2+a4DIDt+a5Dt 2+ ξ, the measurement current Ipt with temperature compensation is calculated.
S6, the host unit 305 sends the measurement data to the CAN online host device through the output unit 306CAN bus, and repeats steps S3 to S6. .
Specifically, in the closed-loop Hall current sensor, a secondary compensation coil and a high-power amplifier for driving a coil are added on an iron core, so that a magnetic field generated by the secondary compensation coil is opposite to a magnetic field generated by a primary current to be measured, after the magnetic fields are balanced, the sensor operates at an operating point with zero magnetic field, and the magnetic field strength B is NpKip and NsKhIs, so that the closed-loop Hall current sensor has the advantages that
Figure BDA0002851571500000071
Np Is the number of turns of the primary side, K Is a constant, Ns Is the number of turns of the secondary side coil, Kh Is a hall constant, and the proportional correspondence between the secondary side compensation coil current Is and the measured primary side coil current Ip of the iron core 307 Is the ratio of the secondary side compensation coil current Is to the measured primary side current Ip and the original secondary side turns ratio
Figure BDA0002851571500000081
The linear direct proportion relation Is formed, the measurement precision of the current Ip of the primary coil to be measured of the closed-loop current sensor Is high by measuring Is, and the linearity Is good; the secondary coil is 2000 turns, the iron core is an annular permalloy magnetic core with an opening, and the Hall sensor is a Hall element HW302B made of indium antimonide (InSb) materials. The primary side compensation coil current Is proportionally corresponding to the primary side coil current Ip to be measured according to the principle of a closed-loop Hall current sensor;
the driving unit provides constant voltage source drive for the sensor, detects the output signal of the sensor, and provides drive for the secondary compensation coil after amplifying 1000 times by the high-power amplification operational amplifier circuit;
the voltage reference circuit selects a 50 ppm/DEG C precision micro-power consumption parallel voltage reference LM4050, and provides a precision reference voltage URef of 2.048V for the differential amplification element and the ADC conversion circuit respectively; the current sampling unit converts the current Is of the secondary compensation coil into a measurement voltage Us through a sampling resistor Rs which Is connected in series with the secondary compensation coil, so that the main control unit obtains the current of the sampling resistor Rs by acquiring the measurement voltage Us, and the main control unit can determine the current value of the current Ip to be measured according to the proportional relation between the current Is and the Ip.
Further, a voltage reference circuit selects a 50 ppm/DEG C precision micro-power consumption parallel voltage reference LM4050 as a reference, provides a precision reference voltage Uref of 2.048V for the differential amplifier and the ADC converter respectively, and converts a coil secondary side current Is into a measurement voltage Us through a sampling resistor Rs of 0.5 omega connected in series with a secondary side compensation coil;
Figure BDA0002851571500000082
a differential amplifying circuit, which is designed by using low-power-consumption rail-to-rail operational amplifiers OPA348 and R1, R2, R3 and R4, wherein R1-R2-10K Ω, and R3-R4-40K Ω, and amplifies the sampled voltage signal Us to Um;
Figure BDA0002851571500000091
will be provided with
Figure BDA0002851571500000092
When Rs is 0.5, Um is 3.3V, URef is 2.048V, and the above formula is substituted, the primary current Ip to be measured is 1252A, and thus, a current of 1000A or less can be measured. The ADC conversion circuit chip adopts high precision, low power consumption and 16 bits, an amplifier capable of differentially inputting programmable gain is arranged in the ADC conversion circuit chip, an SPI bus analog-to-digital converter ADS1118 accesses the voltage Um and the voltage URef to the chip programmable gain differential amplifier, the voltage difference value obtained by subtracting the voltage URef from the Um is converted into a digital signal, and the digital signal is sent to the MCU through the SPI bus.
In this embodiment, the step S4 includes the following steps:
function I of the current to be measured Iptpt=f(DI,Dt);
The two-dimensional regression mathematical model of the temperature compensation of the current to be measured is as follows:
Ipt=a0+a1DI+a2Dt+a3DI 2+a4DIDt+a5Dt 2+ξ;
where ξ is the high order infinitesimal, Di is the ADC value of the current sample, Dt is the ADC value of the ambient temperature sample, and α 0, α 1, α 2, α 3, α 4, and α 5 are constants.
In the present embodiment, determining the values of α 0, α 1, α 2, α 3, α 4, and α 5 includes the following steps;
measuring N current inputs In provided by the drive unit 302 at M constant temperatures;
sampling M temperature working temperature AD values Dt and M multiplied by N current AD values Di;
fitting the current AD value Di, the temperature working temperature AD value Dt and the current input In by using a least square method, and obtaining the following result according to the least square method principle that the root mean square R is minimum:
Figure BDA0002851571500000093
obtaining an extreme value condition according to the multivariate function, setting each partial derivative of a0-a5 as 0 to obtain a linear equation, and obtaining coefficients of a0-a5 after arrangement;
and substituting the coefficients a0-a5 into the temperature compensation two-dimensional regression mathematical model of the current to be measured.
Specifically, the measured primary side current Ip and the current AD value Di are in a linear relation, so that a current function Ipt with temperature compensation and a current sampling ADC value D are directly establishediAnd the temperature sampling value DtThe function model is as follows: i ispt=f(DI,Dt),IptFor the compensated current to be measured, DiADC value for current sampling, DtThe ADC value sampled for the ambient temperature,α0、α1、α2、α3、α4and alpha5Is constant, and therefore the value is determined by the following steps;
further, the current sensor is placed In a thermostat device, n standard values In output by a constant voltage source are measured at m constant temperatures, m temperature sampling ADC values Dt and m multiplied by n uncompensated current sampling ADC values Di are respectively sampled, the current sampling values Di, the temperature sampling values Dt and the standard values In are fitted by using a least square method, the root mean square R is minimum according to a least square principle, the mean square error R is a function of alpha 0-alpha 5, an extreme value condition is solved according to a multivariate function, each partial derivative of alpha 0-alpha 5 is set to be 0, six linear equations are obtained, the six linear equations are arranged to obtain coefficients of alpha 0-alpha 5, and the coefficients alpha 0-alpha 5 are substituted into a to-be-measured current temperature compensation two-dimensional regression model to obtain a mathematical function of to-be-measured current IPt with temperature compensation.
To better explain the present application, the present application provides an example using a full scale 500A as an example, 50A, 100A, 150A, 200A, 250A, 300A, 350A, 400A, 450A, and 500A are measured at 8 constant temperatures of 5 ℃, 15 ℃, 25 ℃, 35 ℃, 45 ℃, 55 ℃, 65 ℃, and 75 ℃, respectively, and n is 10 standard current values In total. As shown in the tables of fig. 6, 7, and 8, according to the Dt and Di data sampled in fig. 6, let each partial derivative of α 0 to α 5 be 0, to obtain six linear equations, and arrange the six linear equations to obtain coefficients of α 0 to α 5, it can be seen that:
a0=-2.3085786、
a1=0.02474745、
a2=0.00178896、
a3=1.18018×10-9
a4=-1.0314292×10-8
a5=4.48797743×10-9
this yields:
Ipt=-2.3085786+0.02474745DI+0.00178896Dt+(1.18018×10-9)DI 2-1.0314292×10-8DIDt+(4.48797743×10-9)Dt 2
substituting Di and Dt of fig. 4 into the above formula, the data of fig. 8 is output according to the following formula:
Figure BDA0002851571500000111
Figure BDA0002851571500000112
comparing the tables, the maximum current value and the minimum current value are 500.513-493.720-6.79A, t2-t1 is 74.33-5.05-69.28 ℃ before temperature compensation, and the above formula is substituted, wherein s is 1.9589 multiplied by 10-3, and t is 1.3571%;
after temperature compensation, the maximum current value and the minimum current value are 501.724-498.414 ═ 3.310A, t2-t1 ═ 74.33-5.05 ═ 69.28 ℃, and the above formula is substituted, wherein s is 8.8781 × 10-5, and t is 0.6598%;
according to the experimental test data of fig. 7 and 8, the temperature coefficient and temperature drift errors before compensation were 1.9589 x 10-3 and 1.3571%, and the temperature coefficient and temperature drift errors after compensation were 8.8781 x 10-5 and 0.6598%, both of which were improved by at least 1 order of magnitude.
In this embodiment, the hardware ambient temperature sampling unit 304, the selected digital-to-analog conversion chip ADS1118 is internally provided with a high-precision (-40-125 ℃, precision 0.5 ℃) digital temperature sensor, and is sent to the main control unit MCU through the SPI bus.
The hardware MCU main control unit 305 adopts an automobile-level 16-bit microcontroller MC9S12 series MCU with a CAN bus. The MCU completes the functions of current sampling, temperature sampling, data operation in processing and data output.
The hardware signal output unit 306 adopts a car type fault protection CAN transceiver TCAN1051V to provide reliable hardware support for establishing communication between the MCU and the CAN host.
After the software module initialization task 401 is powered on, the system enters a module initialization task, which includes a bottom layer driver to be called by each task module, such as system clock initialization, timer 1ms interrupt initialization, debugging serial port initialization, ADC drive initialization, SPI bus drive initialization, CAN bus drive initialization, and the like. After the module initialization task 401 is completed, an idle task 406 is entered.
The software current sampling task 402 is triggered and started once every 2ms, the system is communicated with the ADS1118 through the SPI bus, current sampling data is read, 32 times of sampling data are continuously read by each task, accidental interference is filtered through a median average filtering method, and adopted data are stored in a cache. After the current sampling task 402 is completed, a data processing task 404 is entered.
The software temperature sampling task 403 is triggered and started once every 20ms, the system is communicated with the ADS1118 through the SPI bus, ambient temperature sampling data is read, 16 times of sampling data are continuously read by each task, accidental interference is filtered through a median average filtering method, and adopted data are stored in a cache. After the current sampling task 403 is completed, the process proceeds to a data processing task 404.
When the current sampling task or the temperature sampling task is completed, the software data processing task 404 performs data processing, and substitutes the AD value Dt of the current sampling and the ADC value Dt of the ambient temperature sampling into a formula, so as to calculate the current to be measured with temperature compensation.
The software CAN communication task 405 is triggered and started once every 10ms, and the system sends the calculated current measurement data and the working state to the master control equipment on the CAN bus through the CAN bus. After the CAN communication task 405 is completed, an idle task 406 is entered.
In the software idle task module 406, the idle task performs a part of task detection and scheduling functions, when the idle task detects that the trigger condition of the current sampling task 402, the temperature sampling task 403 or the CAN communication task 405 is met, the corresponding task is entered, and if the trigger condition of the task is not detected, the idle task waits for the meeting of the trigger condition.
The above description is only for the purpose of illustrating the preferred embodiments of the present application and is not intended to limit the scope of the present application, which is within the scope of the present application, except that the same or similar principles and basic structures as the present application may be used.

Claims (7)

1. The utility model provides a take temperature compensation's car level hall current sensor which characterized in that: the temperature measurement device comprises a hardware part and a software part, wherein the hardware part comprises a probe unit (301), a driving unit (302), a current sampling unit (303), a temperature sampling unit (304), a main control unit (305) and an output unit (306);
the probe unit (301) comprises an annular iron core (307), a secondary compensation coil (308) wound on the annular iron core, and a Hall element (309), and converts a primary side current Ip to a secondary side compensation coil current Is;
the driving unit (302) is connected with the probe unit (301) and used for providing a working constant voltage source for the Hall element (309) and amplifying an output signal of the Hall element (309) through an operational amplifier to provide driving for the secondary compensation coil (308);
the current sampling unit (303) comprises a reference voltage reference circuit, a current sampling circuit, a differential amplification circuit and an ADC (analog to digital converter) conversion circuit, Is connected with the driving unit (302), converts the current Is of the secondary compensation coil into a digital value current AD value Di through current-voltage conversion, signal amplification conditioning and the ADC conversion circuit, and sends the digital value current AD value Di to the main control unit (305) through an SPI (serial peripheral interface) bus;
the temperature sampling unit (304) converts the acquired temperature into a digital value temperature AD value Dt through an ADC conversion circuit, and sends the digital value temperature AD value Dt into the main control unit (305) through an SPI bus;
the main control unit (305) calculates the current to be measured Ipt with the temperature compensation zone according to the sampled current AD value Di and the sampled working temperature AD value Dt;
the output unit (306) provides a CAN communication interface for outputting the current to be measured Ipt with temperature compensation, and provides reliable hardware support for establishing communication between the main control unit (305) and a CAN host.
2. The automotive grade hall current sensor with temperature compensation of claim 1, wherein: the software part comprises a system initialization task (401), a current sampling task (402), a temperature sampling task (403) and a data processing task (404), a CAN bus communication task (405) and an idle task (406);
the system initialization task (401) is used for completing the initialization of bottom layer drivers of modules such as a system clock, a timer, a debugging serial port, a watchdog, an SPI bus, a CAN bus and the like, and entering the idle task (406) after the initialization is completed;
the current sampling task (402) is triggered and started once every 2ms, a current AD value Di is sampled for 32 times continuously, filtering is carried out by a median average method, data are stored in a cache, and after the filtering is finished, the idle task (406) is started;
the temperature sampling task (403) is triggered and started once every 20ms, the working temperature AD value Dt is sampled for 15 times continuously, median average filtering is carried out, data are stored in a cache, and the idle task (406) is started after the data are stored in the cache;
the data processing task (404) is used for substituting the current AD value Di and the temperature AD value Dt into a mathematical function of a current value to be measured of the Hall current sensor with temperature compensation, calculating a current Ipt to be measured with the temperature compensation and storing data into a cache, and entering the idle task (406) after the calculation is finished;
the CAN communication task (405) is triggered and started once every 10ms, the measured current data is sent to a main control device on a CAN bus in a CAN message mode, and after the task is completed, an idle task (406) is entered;
and the idle task (406) plays a role of task scheduling, enters a corresponding task after detecting that the triggering conditions of the current sampling task (402), the temperature sampling task (403) or the CAN communication task (405) are met, and waits for the meeting of the triggering conditions if the triggering of the task is not detected.
3. The automotive grade hall current sensor with temperature compensation of claim 2, wherein: the method comprises the following steps:
s1, powering on the system, initializing the software part and the hardware part and starting the operation;
s2, a driving unit (302) amplifies a signal output by a Hall element (309) of a probe unit (301) through an operational amplifier, and then provides driving for a secondary compensation coil (308), and according to the principle of a closed-loop current sensor, the current Ip of a primary side coil Is converted into the current Is of a secondary side compensation coil;
s3, the current sampling unit (303) converts the current Is measured by the secondary compensation coil in the step S2 into a measured voltage Us through a sampling resistor RS, the measured voltage Us Is amplified and conditioned through a differential amplifier circuit and then converted into a measured voltage Um, the measured voltage Um Is converted into a current AD value Di through an ADC (analog to digital converter) conversion circuit, and the current AD value Di Is sent to the main control unit (305) through an SPI (serial peripheral interface) bus;
s4, the temperature sampling unit (304) converts the working environment temperature into a measurement voltage Ut, the measurement voltage Ut is converted into a temperature AD value Dt through the ADC conversion circuit, and the temperature AD value Dt is sent to the main control unit (303) through the SPI bus;
s5, the main control unit (305) substitutes the current AD value Di sampled in the step S3 and the temperature AD value Dt sampled in the step S4 into a current measurement temperature compensation function I of a two-dimensional regression method fitting curve algorithm based on the least square methodpt=a0+a1DI+a2Dt+a3DI 2+a4DIDt+a5Dt2+ ξ, calculating the measurement current Ipt with temperature compensation;
s6, the master control unit (305) sends the measurement data to the host device through the output unit (306), and repeats steps S3 to S6.
4. The automotive grade hall current sensor with temperature compensation of claim 3, wherein: the drive unit (302) converts the current Ip of the primary side coil into the current Is of the secondary side compensation coil, the Hall element outputs signals, the signals are amplified by the operational amplifier and then drive the secondary side compensation coil, the magnetic field generated by the secondary side compensation coil Is opposite to the magnetic field generated by the primary side current to be measured, after the magnetic field Is balanced, the Hall sensor operates at a working point with zero magnetic field, and the magnetic field intensity B Is NpKIp=NsKhIsAnd therefore, the first and second electrodes are,
Figure FDA0002851571490000031
wherein K is a constant, KhIs a constant of the hall-effect transistor,
Figure FDA0002851571490000032
the primary side coil current Ip can be calculated by measuring the secondary side compensation coil current Is because of the original secondary side turn ratio.
5. The automotive-grade hall current sensor with temperature compensation of claim 4, wherein: the current sampling unit (303) converts the secondary compensation coil measuring current Is into a current AD value Di, and comprises a reference voltage reference circuit, a current sampling circuit, a differential amplification circuit and an ADC conversion circuit;
measuring the current I on the secondary side of the coil through a sampling resistor Rs connected in series with the secondary side compensation coilsConverted into a measuring voltage Us
Figure FDA0002851571490000041
A differential amplifier circuit for measuring the voltage UsAmplifying and conditioning into analog voltage Um
Figure FDA0002851571490000042
Wherein
Figure FDA0002851571490000043
The turn ratio of the primary side and the secondary side is determined, Rs is a sampling resistor, R1 is R2, R3 is R4,
Figure FDA0002851571490000044
the differential operational amplifier is used as a differential operational amplifier amplification factor, and Uref is used as a reference voltage;
Figure FDA0002851571490000045
will simulate the voltage UmAnd URefAn ADC conversion chip is connected to convert Um-URefThe voltage difference is converted into a current AD value Di which is sent to a main control unit (305) through an SPI bus, and the primary current measurement is converted into Um-URefAnd measuring the voltage difference, namely the current AD value Di.
6. A temperature compensation method of an automobile-level Hall current sensor is based on the automobile-level Hall current sensor of any one of claims 1-5, and is characterized in that: the method comprises the following steps:
establishing a current I to be measured with temperature compensationptAnd the sampling current ADC value DIAnd sampling the working environment temperature ADC value DtFunction model:
Ipt=f(DI,Dt);
the two-dimensional regression mathematical model of the temperature compensation of the current to be measured is as follows:
Ipt=a0+a1DI+a2Dt+a3DI 2+a4DIDt+a5Dt 2
where ξ is the high order infinitesimal, Di is the ADC value of the current sample, Dt is the ADC value of the ambient temperature sample, and α 0, α 1, α 2, α 3, α 4, and α 5 are constants.
7. The temperature compensation method of the automotive-grade hall current sensor according to claim 6, wherein: determining the values of the constants alpha 0, alpha 1, alpha 2, alpha 3, alpha 4 and alpha 5 to obtain the complete value I of the current to be measured of the Hall current sensor with temperature compensationptThe mathematical function of (1), comprising the steps of;
placing the current sensor in a thermostat device, and measuring n standard measuring currents I at m constant temperaturesnRespectively sampling m temperature sampling ADC values DtAnd m × n uncompensated current sample ADC values DI
Sampling value D of current by using least square methodITemperature sampling value DtAnd inputting a calibration standard value InThe fit is made according to the least squares principle that the root mean square R should be minimal:
Figure FDA0002851571490000051
mean square error R is a0~a5According to the multiple functions, the extreme value condition is solved, let a0~a5Each partial derivative of (a) is 0 to obtain six linear equations, arranging the six-element linear equations, and solving to obtain a constant a0~a5
Will be constant a0~a5Substituting the temperature compensation two-dimensional regression mathematical model into the current to be measured to obtain the complete current value I to be measured of the Hall current sensor with temperature compensationptThe mathematical function of (a) is solidified in the program, and the current value to be measured of the hall sensor is calculated by step S5.
CN202011529153.7A 2020-12-22 2020-12-22 Automobile-level Hall current sensor with temperature compensation and compensation method thereof Pending CN112730963A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011529153.7A CN112730963A (en) 2020-12-22 2020-12-22 Automobile-level Hall current sensor with temperature compensation and compensation method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011529153.7A CN112730963A (en) 2020-12-22 2020-12-22 Automobile-level Hall current sensor with temperature compensation and compensation method thereof

Publications (1)

Publication Number Publication Date
CN112730963A true CN112730963A (en) 2021-04-30

Family

ID=75605453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011529153.7A Pending CN112730963A (en) 2020-12-22 2020-12-22 Automobile-level Hall current sensor with temperature compensation and compensation method thereof

Country Status (1)

Country Link
CN (1) CN112730963A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113466534A (en) * 2021-09-06 2021-10-01 常州常荣传感技术有限公司 Low-power-consumption intelligent current sensor and working mode control method thereof
CN114296019A (en) * 2021-12-19 2022-04-08 宁波泰丰源电气有限公司 Temperature compensation structure of direct current sensor
CN117284086A (en) * 2023-11-17 2023-12-26 深圳市长天智能有限公司 Contactor control method, power supply system and automobile

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201118193Y (en) * 2007-10-19 2008-09-17 宁波天安(集团)股份有限公司 Self-powered digital current relay
CN202256454U (en) * 2011-10-12 2012-05-30 长沙南车电气设备有限公司 Current sensor
CN103185832A (en) * 2011-12-31 2013-07-03 上海汽车集团股份有限公司 Hall sensor temperature compensation method in automobile and relevant hall sensor
CN106199166A (en) * 2016-07-11 2016-12-07 深圳市知用电子有限公司 A kind of method and device of current measurement
CN109633233A (en) * 2018-12-21 2019-04-16 华为数字技术(苏州)有限公司 A kind of Closed Loop Hall and detection method
CN209570635U (en) * 2018-12-19 2019-11-01 上海良信电器股份有限公司 A kind of improved circuit breaker electric flow measurement module
CN110426552A (en) * 2019-07-29 2019-11-08 贵州恒芯微电子科技有限公司 A method of current sample precision is improved by numerically controlled temperature-compensating
CN110658374A (en) * 2019-11-14 2020-01-07 河北申科电子股份有限公司 Current transformer with wide frequency, wide measurement and anti-magnetic interference capability
CN110687347A (en) * 2019-09-26 2020-01-14 西安航天计量测试研究所 Hall current sensor with temperature compensation and temperature compensation method thereof

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201118193Y (en) * 2007-10-19 2008-09-17 宁波天安(集团)股份有限公司 Self-powered digital current relay
CN202256454U (en) * 2011-10-12 2012-05-30 长沙南车电气设备有限公司 Current sensor
CN103185832A (en) * 2011-12-31 2013-07-03 上海汽车集团股份有限公司 Hall sensor temperature compensation method in automobile and relevant hall sensor
CN106199166A (en) * 2016-07-11 2016-12-07 深圳市知用电子有限公司 A kind of method and device of current measurement
CN209570635U (en) * 2018-12-19 2019-11-01 上海良信电器股份有限公司 A kind of improved circuit breaker electric flow measurement module
CN109633233A (en) * 2018-12-21 2019-04-16 华为数字技术(苏州)有限公司 A kind of Closed Loop Hall and detection method
CN110426552A (en) * 2019-07-29 2019-11-08 贵州恒芯微电子科技有限公司 A method of current sample precision is improved by numerically controlled temperature-compensating
CN110687347A (en) * 2019-09-26 2020-01-14 西安航天计量测试研究所 Hall current sensor with temperature compensation and temperature compensation method thereof
CN110658374A (en) * 2019-11-14 2020-01-07 河北申科电子股份有限公司 Current transformer with wide frequency, wide measurement and anti-magnetic interference capability

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113466534A (en) * 2021-09-06 2021-10-01 常州常荣传感技术有限公司 Low-power-consumption intelligent current sensor and working mode control method thereof
CN113466534B (en) * 2021-09-06 2021-12-03 常州常荣传感技术有限公司 Low-power-consumption intelligent current sensor and working mode control method thereof
CN114296019A (en) * 2021-12-19 2022-04-08 宁波泰丰源电气有限公司 Temperature compensation structure of direct current sensor
CN117284086A (en) * 2023-11-17 2023-12-26 深圳市长天智能有限公司 Contactor control method, power supply system and automobile
CN117284086B (en) * 2023-11-17 2024-02-09 深圳市长天智能有限公司 Contactor control method, power supply system and automobile

Similar Documents

Publication Publication Date Title
CN112730963A (en) Automobile-level Hall current sensor with temperature compensation and compensation method thereof
CN110687347B (en) Hall current sensor with temperature compensation and temperature compensation method thereof
US9702909B2 (en) Manufacturing method for current sensor and current sensor
CN104236742A (en) Method and device for precisely measuring temperatures of platinum resistors
EP2752673A1 (en) Method and device for measuring current
CN106443159B (en) Current detection chip
CN112415458A (en) Current sensor linearity testing system and calibration method
CN208334490U (en) A kind of micro-current Precision measurement circuit
CN211206616U (en) Hall current sensor with temperature compensation
CN209992560U (en) High-precision current sampling circuit
CN111207851A (en) Six-wire system separated Wheatstone bridge temperature measurement structure and method
JPS6325572A (en) Leakage current measuring system of electrometer amplifier
CN112525367B (en) Remote temperature measuring device and measuring method applied to marine environment
CN214041538U (en) Current and voltage detection circuit based on single chip microcomputer
CN117420359A (en) Full-dynamic-range high-precision resistance measuring structure and measuring method thereof
CN113156192A (en) Current sampling device of high-voltage system of new energy vehicle
CN111208346B (en) Small signal voltage measuring device and method
CN111141406B (en) PT100 temperature measurement system and temperature measurement method
CN102288318A (en) Temperature detection circuit of permanent magnet synchronous motor and controller system for electric vehicle
CN113820029A (en) PT100 temperature acquisition circuit for acquisition terminal
CN111342785A (en) Signal conditioning circuit
CN219738060U (en) uA level high-precision constant current source system
CN114636430B (en) High-precision magnetic navigation sensor based on interpolation method and positioning method
CN212208683U (en) Self-assembled bridge experimental device
JP3562703B2 (en) Measuring device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination