High-precision thermistor temperature detection circuit and method thereof
By using a differential temperature detection circuit and a multi-calibration voltage excitation method, combined with the Steinhart-Hart model, the problem of decreased temperature measurement accuracy caused by long-term drift of NTC thermistors in automotive electronic systems is solved, achieving high-precision and high-reliability temperature detection.
Patent Information
- Application Number
- CN202611419502.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-06
AI Technical Summary
In automotive electronic systems, NTC thermistors can drift irreversibly due to prolonged high temperatures and vibrations, leading to a decrease in temperature measurement accuracy and affecting the accuracy and safety of BMS systems, air conditioning systems, and motor protection in new energy vehicles.
By employing a differential temperature detection circuit, an analog-to-digital converter, an error comprehensive compensation calculation circuit, and a calibration signal generation circuit, and through multi-calibration voltage excitation and the Steinhart-Hart model, nonlinear temperature calculation and drift error calibration of the thermistor resistance-temperature relationship are achieved, thus constructing a digital compensation and nonlinear temperature calculation mechanism.
It significantly improves the measurement accuracy and stability of thermistors in automotive electronic systems, effectively compensates for temperature measurement errors caused by device aging, high-temperature stress and mechanical vibration, and improves the long-term reliability of temperature detection systems.
Smart Images

Figure CN123045555A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a high-precision thermistor temperature detection circuit and method, belonging to the field of automotive electronics technology. Background Technology
[0002] Thermistors, as a low-cost temperature detection method, are widely used in various electronic control systems of new energy vehicles, such as engine cooling systems, air conditioning systems, seat heating, power battery packs, inverters, and OBCs, providing temperature compensation and overheat protection. Due to the significant temperature nonlinearity of NTC thermistors, nonlinearity compensation is usually required in software to obtain high-precision temperature readings. However, under the harsh environments of long-term high temperatures and continuous vibrations in automotive electronics, the temperature characteristics of thermistors shift over time. Prolonged exposure to high temperatures accelerates the migration of lattice defects in semiconductor ceramics, leading to irreversible drift in the resistance-temperature curve; while high-frequency vibrations may cause microcracks in lead solder joints or internal stresses resulting from mismatched expansion coefficients of packaging materials, further exacerbating parameter instability. Under the combined influence of these factors, the annual drift of the absolute resistance and temperature characteristic accuracy of NTC thermistors may exceed 0.5%, with an equivalent temperature error reaching ±0.5℃ / year. The accumulated long-term temperature characteristic deviation error over many years may reach more than 3%.
[0003] The direct impact of the irreversible shift of NTC thermistors over time is a decrease in temperature measurement accuracy, which has a significant impact on scenarios with high temperature control accuracy requirements. For example, in the BMS system of new energy vehicles, decreased temperature measurement accuracy can lead to deviations in the BMS's estimation of SOC / SOH, causing misjudgments in charging strategies or delayed thermal management responses. In air conditioning systems, it may result in inaccurate temperature control, affecting driving comfort; in motor or power module protection, distorted temperature feedback may prevent timely triggering of overheat protection, increasing the risk of thermal runaway and seriously threatening vehicle operational safety and system reliability. Therefore, providing a high-precision, high-reliability temperature detection circuit and control method that can compensate for the temperature measurement accuracy error caused by the irreversible shift of NTC thermistors over time after long-term operation has significant application value for high-precision automotive electronic systems. Summary of the Invention
[0004] Based on existing technologies, this invention provides a high-precision and high-reliability thermistor temperature detection circuit and method, which improves the speed and accuracy of temperature detection in various functional modules of automobiles.
[0005] The high-precision thermistor temperature detection circuit of the present invention includes a differential temperature detection circuit composed of thermistor Rntc1, thermistor Rntc2, voltage divider resistor Rm1, voltage divider resistor Rm2, and programmable gain amplifier. It is characterized in that it further includes an analog-to-digital converter, an error comprehensive compensation calculation circuit, a calibration signal generation circuit, a control circuit, a drift error calibration data storage circuit, a basic calibration data storage circuit, a program memory, and a clock signal generation circuit. The upper ends of thermistors Rntc1 and Rntc2 are connected to the calibration voltage Vrcal output by the calibration signal generation circuit. The lower end of thermistor Rntc1 is connected to the upper end of the voltage divider resistor Rm1 and the inverting input of the programmable gain amplifier, outputting the temperature detection voltage Vrt1. The lower end of thermistor Rntc2 is connected to the upper end of the voltage divider resistor Rm2 and the non-inverting input of the programmable gain amplifier, outputting the temperature detection voltage Vrt2. The lower ends of the voltage divider resistors Rm1 and Rm2 are grounded. The output of the programmable gain amplifier is connected in sequence to the analog-to-digital converter and the error comprehensive compensation calculation circuit; the error comprehensive compensation calculation circuit is connected to the data output terminal dat1 and the address input terminal adr1 of the drift error calibration data storage circuit and the data output terminal dat2 and the address input terminal adr2 of the basic calibration data storage circuit. The program memory is connected to the control circuit. The control circuit generates control signals according to the control program in the program memory, which are respectively connected to the calibration signal generation circuit, the drift error calibration data storage circuit, the basic calibration data storage circuit, the error comprehensive compensation calculation circuit, and the clock signal generation circuit. This is used to control the switching of the system's working mode and the coordinated operation of each functional module. The clock signal generation circuit is used to generate the clock signal required for normal system operation during the period when the system enable signal is valid. The basic calibration data storage circuit stores the quantization thermistor resistance value R using an address indexing method. ntc And the Steinhart-Hart model parameters for the corresponding temperature range, the stored contents of which are: {adr2(i), R ntc (i), A i B i C i} Where adr2(i) represents the i-th memory address, R ntc (i) represents the quantized thermistor resistance value at the corresponding address, A i B i and C i These represent the Steinhart-Hart model parameters for the corresponding temperature ranges; The error comprehensive compensation calculation circuit has two operating modes: drift error calibration mode and normal temperature measurement mode. In drift error calibration mode, an address signal adr1 is generated based on the actual calibration digital code output by the analog-to-digital converter. The drift error calibration data storage circuit is accessed to read the reference digital code of the corresponding calibration temperature point. The drift error corresponding to multiple calibration voltages is calculated and fused to generate a unique digital compensation code corresponding to the current calibration temperature point and write it into the drift compensation register. In normal temperature measurement mode, the digital compensation code in the drift compensation register is read to complete the drift error compensation. Then, an address signal adr2 is generated based on the compensated digital code. The basic calibration data storage circuit is accessed to read the corresponding quantized thermistor resistance value and Steinhart-Hart model parameters. The nonlinear temperature calculation of the relationship between the thermistor resistance value and temperature is completed, and the final temperature detection result is output.
[0006] Specifically, the drift error calibration data storage circuit stores the reference digital code corresponding to each calibration temperature point in an address index manner. Its storage content is: {adr1(i), Dref(i)}, where adr1(i) represents the i-th storage address and Dref(i) represents the reference digital code of the corresponding calibration temperature point.
[0007] Specifically, the error comprehensive compensation calculation circuit includes a drift error calculation module, a drift compensation module, a nonlinear temperature calculation module, and an error comprehensive control circuit; the error comprehensive control circuit generates control signals Ctr1, Ctr2, and Ctr3 to control the drift error calculation module, the drift compensation module, and the nonlinear temperature calculation module to work according to a preset timing sequence, respectively. The drift error calculation module calculates the drift error err(j) based on the actual calibration digital code Dcal(j) and the reference digital code Dref(i) corresponding to each calibration voltage Vrcal(j), and fuses multiple drift errors to obtain a comprehensive drift error. This is then used to generate a unique digital compensation code D corresponding to the current calibration temperature point. comp Write it to its own drift compensation register, where err(j) represents the drift error of the j-th group; The digital compensation code D comp In normal temperature measurement mode, the drift compensation module reads the measurement digital code Dtmp output by the analog-to-digital converter and performs drift error compensation to obtain the compensated digital code Dtcal. The nonlinear temperature calculation module generates an address signal adr2 based on the compensated digital code Dtcal to access the basic calibration data storage circuit, read the corresponding quantized thermistor resistance value and Steinhart-Hart model parameters, and completes the nonlinear temperature calculation of the relationship between thermistor resistance value and temperature based on the Steinhart-Hart model, outputting the temperature detection result Tcal.
[0008] Specifically, the clock signal generation circuit generates signals including calibration control clock Dclk, analog-to-digital converter operating clock Clk1, and error comprehensive compensation calculation circuit operating clock Clk2, to ensure that the calibration signal generation circuit, analog-to-digital converter, and error comprehensive compensation calculation circuit operate in a coordinated manner according to a preset timing sequence.
[0009] The drift error calibration mode occupies a total of K+1 control clocks Dclk, where the first K Dclk correspond to the acquisition of digital codes under K calibration voltages, and the K+1 Dclk is used to complete the last set of drift error calculation, error fusion and writing of digital compensation codes into the drift compensation register; the normal temperature measurement mode occupies 2 Dclk, where the first Dclk completes drift compensation and the second Dclk completes nonlinear temperature calculation.
[0010] The temperature detection method of the high-precision thermistor temperature detection circuit of the present invention includes the following steps: S1. The control circuit controls the system to enter the drift error calibration mode. The calibration signal generation circuit outputs multiple preset calibration voltages in sequence, and the analog-to-digital converter obtains the corresponding actual calibration digital code. S2. The error comprehensive compensation calculation circuit generates an address signal adr1 based on the actual calibration digital code. It accesses the drift error calibration data storage circuit based on the address signal adr1 to read the reference digital code of the corresponding calibration temperature point, calculates the drift error corresponding to multiple calibration voltages, performs error fusion, generates a unique digital compensation code corresponding to the current calibration temperature point, and writes it into the drift compensation register. S3. The control circuit controls the system to enter the normal temperature measurement mode. The analog-to-digital converter outputs the current measurement digital code, reads the digital compensation code in the drift compensation register to complete the drift error compensation, and obtains the compensated digital code. S4. Generate an address signal adr2 based on the compensated digital code. Access the basic calibration data storage circuit based on the address signal adr2 to read the corresponding quantized thermistor resistance value and Steinhart-Hart model parameters. Perform nonlinear temperature calculation on the relationship between thermistor resistance value and temperature based on the Steinhart-Hart model, and output the final temperature detection result.
[0011] The control circuit generates a system enable signal EN, a duty cycle start signal SET, and mode enable control signals Cal1 and Cal2 based on the control program in the program memory. The system enable signal EN is used to control the start and stop of the entire temperature detection circuit; the duty cycle start signal SET is used to start a new temperature detection duty cycle; and the mode enable control signals Cal1 and Cal2 are used to enable the drift error calibration process and the normal temperature measurement process, respectively, so as to realize that each functional module works in a coordinated manner according to the preset timing sequence.
[0012] Specifically, the drift error calculation in step S2 adopts a pipelined processing method. The control signal Ctr1 is generated with a delay of one control clock Dclk relative to the control signal Cal1, so that the corresponding drift error is calculated immediately after each group of actual calibration digital codes completes analog-to-digital conversion, and the error fusion and digital compensation code generation are completed within the last control clock.
[0013] Compared with existing technologies, this invention has the following advantages: This invention employs a multi-calibration voltage excitation method to perform multi-point measurements at the same calibration temperature. Based on the actual digital code, an address signal is generated through decoding, accessing the drift error calibration data storage circuit to read the corresponding reference digital code. Furthermore, by fusing drift errors under multiple calibration voltages, a unique digital compensation code corresponding to the current calibration temperature point is generated, achieving accurate extraction and compensation of long-term drift errors of the thermistor. Because this invention uses a ratio measurement method, the reference digital code corresponding to the same calibration temperature is independent of the calibration voltage amplitude. Therefore, only a one-dimensional reference digital code database is needed to complete drift error calibration, effectively reducing storage capacity and improving data access efficiency, as well as the stability and accuracy of drift error compensation.
[0014] Meanwhile, this invention organically combines long-term drift compensation with the nonlinear temperature calculation of the thermistor resistance-temperature relationship, constructing a digital compensation and nonlinear temperature calculation mechanism based on multi-calibration voltage excitation. During normal temperature measurement, the digital code drift is first compensated using the digital compensation code in the drift compensation register. Then, the basic calibration data storage circuit is accessed based on the compensated digital code to read the corresponding quantized thermistor resistance value and Steinhart-Hart model parameters, thus realizing the nonlinear temperature calculation of the thermistor resistance-temperature relationship. This method not only effectively compensates for temperature measurement errors caused by factors such as device aging, high-temperature stress, mechanical vibration, packaging stress changes, and analog front-end circuit drift during long-term operation of the thermistor, but also corrects the nonlinear characteristics of the thermistor itself, thereby significantly improving the measurement accuracy, stability, and reliability of the automotive electronic temperature detection system during long-term operation. Attached Figure Description
[0015] Figure 1 This is a block diagram of the high-precision thermistor temperature detection circuit of the present invention.
[0016] Figure 2 for Figure 1 Block diagram of the drift error calibration data storage circuit.
[0017] Figure 3 for Figure 1 Block diagram of the basic calibration data storage circuit.
[0018] Figure 4 This is a schematic diagram showing the relationship between the digital code changes under different calibration voltages according to the present invention.
[0019] Figure 5 for Figure 1 Block diagram of the principle of the error comprehensive compensation calculation circuit.
[0020] Figure 6 This is a timing diagram of the high-precision thermistor temperature detection circuit of the present invention.
[0021] Figure 7 This is a flowchart illustrating the workflow of the present invention in drift error calibration mode.
[0022] Figure 8 This is a flowchart illustrating the workflow of the present invention in normal temperature measurement mode. Detailed Implementation
[0023] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0024] This invention employs a differential thermistor measurement structure, which improves the common-mode rejection capability of the temperature detection circuit through differential measurement, effectively reducing the impact of power supply fluctuations, external noise, and common-mode interference on the temperature measurement results.
[0025] like Figure 1 As shown, the high-precision thermistor temperature detection circuit includes thermistor Rntc1, thermistor Rntc2, voltage divider resistor Rm1, voltage divider resistor Rm2, programmable gain amplifier (PGA) 1, analog-to-digital converter (ADC) 2, error comprehensive compensation calculation circuit 3, drift error calibration data storage circuit 6, basic calibration data storage circuit 7, program memory 8, control circuit 5, calibration signal generation circuit 4, and clock signal generation circuit 9.
[0026] The thermistors Rntc1 and Rntc2, voltage divider resistors Rm1 and Rm2, and programmable gain amplifier 1 constitute a differential temperature detection circuit. The upper ends of thermistors Rntc1 and Rntc2 are connected to the calibration voltage Vrcal output by the calibration signal generation circuit 4. The lower end of thermistor Rntc1 forms the temperature detection voltage Vrt1 and is connected to the upper end of voltage divider resistor Rm1 and the negative input terminal of programmable gain amplifier 1. The lower end of thermistor Rntc2 forms the temperature detection voltage Vrt2 and is connected to the upper end of voltage divider resistor Rm2 and the positive input terminal of programmable gain amplifier 1. The lower ends of voltage divider resistors Rm1 and Rm2 are both grounded. Programmable gain amplifier 1 amplifies the differential signals of temperature detection voltages Vrt1 and Vrt2, outputting a differential signal Vdiff. Analog-to-digital converter 2 converts the differential signal Vdiff into a digital code Dtmp and sends it to the error comprehensive compensation calculation circuit 3.
[0027] The control circuit 5 is connected to the program memory 8, which stores the system control program and control strategy. The control circuit 5 generates a system enable signal EN, a duty cycle start signal SET, and mode enable control signals Cal1 and Cal2 based on the control program in the program memory 8. The system enable signal EN controls the start and stop of the entire temperature detection circuit; the duty cycle start signal SET starts a new temperature detection duty cycle; and the mode enable control signals Cal1 and Cal2 enable the drift error calibration process and the normal temperature measurement process, respectively, thereby enabling the various functional modules to work in a coordinated manner according to a preset timing sequence.
[0028] The data output terminal dat1 of the drift error calibration data storage circuit 6 is connected to the error comprehensive compensation calculation circuit 3, and the address input terminal adr1 is connected to the error comprehensive compensation calculation circuit 3, which is used to output the reference digital code corresponding to the calibration temperature point according to the address signal.
[0029] The data output terminal dat2 of the basic calibration data storage circuit 7 is connected to the error comprehensive compensation calculation circuit 3, and the address input terminal adr2 is also connected to the error comprehensive compensation calculation circuit 3. This circuit is used to output the quantized thermistor resistance value R at the corresponding address based on the address signal. ntc and the Steinhart-Hart model for the corresponding temperature range The parameters A, B, and C are given, and T is the Kelvin temperature.
[0030] The error comprehensive compensation calculation circuit 3 is connected to the analog-to-digital converter 2, the drift error calibration data storage circuit 6, and the basic calibration data storage circuit 7, respectively. It is used to receive the digital code output by the analog-to-digital converter 2, and under the control of the control signal output by the control circuit 5, it completes the generation of digital compensation code, drift error compensation, address generation, and nonlinear temperature calculation of the thermistor resistance-temperature relationship, and finally outputs the temperature detection result Tcal.
[0031] The calibration signal generation circuit 4 is used to sequentially output multiple preset calibration voltages Vrcal under the control of the calibration control clock Dclk output by the control circuit 5, so as to provide calibration excitation signals for the drift error calibration mode.
[0032] The clock signal generation circuit 9 is used to generate the clock signals required for normal system operation during the period when the system enable signal EN is valid. These include the calibration control clock Dclk, the analog-to-digital converter 2 operating clock Clk1, and the error comprehensive compensation calculation circuit 3 operating clock Clk2, so as to ensure that the calibration signal generation circuit 4, the analog-to-digital converter 2, and the error comprehensive compensation calculation circuit 3 operate in a coordinated manner according to the preset timing sequence.
[0033] The error comprehensive compensation calculation circuit 3 is internally equipped with an error comprehensive control circuit. The error comprehensive control circuit generates control signals Ctr1, Ctr2 and Ctr3 according to the mode enable control signal output by the control circuit 5 and the working clock Clk2, which respectively control the drift error calculation, drift compensation and nonlinear temperature solution process.
[0034] Figure 2 This is a schematic block diagram of the drift error calibration data storage circuit 6 of the present invention. The drift error calibration data storage circuit 6 stores reference digital codes corresponding to each calibration temperature point of the thermistor under standard operating conditions, providing standard reference data for the system to perform drift error calibration. This reference data is obtained from the system's factory calibration and is permanently stored in non-volatile memory, serving as the benchmark data for drift error calibration throughout the entire product lifecycle.
[0035] Specifically, during the factory calibration phase, the thermistor under test is placed in a constant temperature chamber, and a high-precision standard temperature sensor is used as the temperature reference. M calibration temperature points are selected throughout the entire operating temperature range:
[0036] Where M represents the total number of calibration temperature points. At each calibration temperature point, the corresponding reference digital code is obtained using a standard measurement environment, and a mapping relationship between the calibration temperature point and the reference digital code is established. The drift error calibration data storage circuit 6 organizes and stores data using an address index method, and its stored content can be represented as:
[0037] in, This represents the address corresponding to the i-th calibration temperature point; This indicates the reference digital code stored at the corresponding address. Since this invention uses a ratio measurement method, under ideal conditions, the reference digital code corresponding to the same calibration temperature is independent of the calibration voltage amplitude. Therefore, for each calibration temperature, only a unique reference digital code needs to be stored. There is no need to establish separate reference databases for different calibration voltages; only a one-dimensional reference digital code database is needed to complete drift error calibration, thereby reducing storage capacity and improving data access efficiency.
[0038] Figure 3 This is a schematic diagram of the basic calibration data storage circuit 7 of the present invention. The basic calibration data storage circuit 7 is used to store the basic calibration data required for the nonlinear calibration of the thermistor. The data is obtained from the system's factory calibration and is stored in a non-volatile memory.
[0039] Specifically, during the factory calibration stage, a constant temperature chamber and a high-precision standard temperature sensor are used to calibrate the resistance-temperature characteristics of the thermistor, establishing the compensated digital code Dtcal and quantizing the thermistor resistance value R. ntc The mapping relationship between them is determined. Based on the different temperature ranges corresponding to the thermistor resistance values, a piecewise Steinhart-Hart model is used for fitting, and the Steinhart-Hart model parameters A, B, and C corresponding to each temperature range are solved.
[0040] The basic calibration data storage circuit 7 organizes and stores data using an address index method, and its stored content can be represented as follows:
[0041] Where L represents the total number of addresses in the basic calibration data storage circuit 7; This represents the i-th address; This indicates the quantized thermistor resistance value stored at the corresponding address; These represent the Steinhart-Hart model parameters for the corresponding temperature ranges.
[0042] Figure 4 This diagram illustrates the relationship between the digital code and its variation under different calibration voltages according to the present invention. The horizontal axis represents the calibration voltage Vrcal output by the calibration signal generation circuit 4, and the vertical axis represents the digital code Dcal output by the analog-to-digital converter 2. Each horizontal line represents the reference digital code Dref(i) corresponding to different calibration temperature points. This reference digital code is provided by the drift error calibration data storage circuit 6 and serves as the standard digital code for each calibration temperature point.
[0043] Since this invention uses a ratio measurement method, under ideal conditions, the digital code corresponding to the same temperature is independent of the calibration voltage Vrcal. Therefore, for any calibration voltage, the digital code output by the analog-to-digital converter 2 should theoretically be equal to the reference digital code corresponding to that temperature. That is, the digital code under different calibration voltages should always remain constant and fall on the reference digital code level line of the corresponding temperature.
[0044] However, in actual operation, due to factors such as device aging caused by long-term operation of the thermistor, high-temperature stress, mechanical vibration, changes in packaging stress, and misalignment of the analog front-end circuit, the actual digital code corresponding to the same temperature will fluctuate slightly with the calibration voltage, as shown by the red curve in the figure. Taking an ambient temperature of approximately 25°C as an example, the actual digital code fluctuates around the reference digital code corresponding to 25°C, and the difference between it and the reference digital code constitutes the drift error. Since the drift error corresponding to different calibration voltages varies, this invention uses multiple calibration voltages to calibrate the same temperature point and combines the drift errors obtained under each calibration voltage to improve the accuracy and stability of the drift error estimation.
[0045] Based on the above-mentioned drift error formation mechanism, this invention designs an error comprehensive compensation calculation circuit 3. By reading the reference digital code in the drift error calibration data storage circuit 6 and comparing it with the actual digital code output by the analog-to-digital converter 2, the drift error corresponding to each calibration voltage is calculated. Multiple drift errors are then fused to generate a unique digital compensation code corresponding to the current calibration temperature point, providing a compensation basis for drift compensation in normal temperature measurement mode and subsequent nonlinear temperature calculation.
[0046] The error comprehensive compensation calculation circuit 3 is used to complete the digital compensation and temperature calculation in the thermistor temperature detection process. It is connected to the analog-to-digital converter 2, the drift error calibration data storage circuit 6, and the basic calibration data storage circuit 7, respectively. Under the control of the control signals Ctr1, Ctr2, and Ctr3 generated by the error comprehensive control circuit, it completes drift error calculation, drift compensation, and nonlinear temperature calculation. Figure 5 As shown, the error comprehensive compensation calculation circuit 3 includes a drift error calculation module, a drift compensation module, and a nonlinear temperature calculation module. The drift error calculation module is used to calculate the drift error generated by the thermistor during long-term operation and generate the corresponding digital compensation code D. comp The drift compensation module is used to compensate for the drift error of the measurement digital code Dtmp output by the analog-to-digital converter 2 using the digital compensation code; the nonlinear temperature calculation module is used to read the basic calibration data according to the compensated digital code Dtcal and complete the nonlinear temperature calculation of the thermistor resistance-temperature relationship.
[0047] This invention also proposes a digital compensation and nonlinear temperature calculation method based on multi-calibration voltage excitation, the working process of which includes a drift error calibration mode and a normal temperature measurement mode. That is, the error comprehensive compensation calculation circuit 3 includes two working modes: drift error calibration mode and normal temperature measurement mode.
[0048] Specifically, in drift error calibration mode, the error synthesis control circuit outputs control signal Ctr1 to enable the drift error calculation module to start working. Analog-to-digital converter 2 outputs the actual calibration digital code Dcal corresponding to each calibration voltage Vrcal and writes it into register 1's buffer. Subsequently, decoder 1 generates an address signal adr1 based on the actual calibration digital code Dcal, accesses the drift error calibration data storage circuit 6 via register 2, and reads the reference digital code Dref (corresponding to dat1 in the figure) for the corresponding calibration temperature point. The error calculation circuit calculates the drift errors err(1), err(2), ..., err(K) corresponding to each calibration voltage. The error fusion circuit further fuses multiple drift errors to generate a unique digital compensation code D corresponding to the current calibration temperature point. comp The digital compensation code is then written into the drift compensation register.
[0049] After completing the drift error calibration, the system enters the normal temperature measurement mode. The error comprehensive control circuit first outputs the control signal Ctr2 to enable the drift compensation module to start working. The analog-to-digital converter 2 outputs the current measurement digital code Dtmp, which, after being buffered by register 1, is compared with the digital compensation code D stored in the drift compensation register. comp Perform addition to compensate for drift error and obtain the compensated digital code Dtcal.
[0050] Subsequently, the error synthesis control circuit outputs control signal Ctr3, enabling the nonlinear temperature calculation module to start working. The compensated digital code Dtcal is buffered in register 2 and then sent to decoder 2. Decoder 2 generates address signal adr2 based on Dtcal, accesses the basic calibration data storage circuit 7 via register 3, and reads the quantization thermistor resistance value R at the corresponding address. ntc The Steinhart-Hart model parameters A, B, and C (corresponding to dat2 in the figure) are used. The nonlinear calibration circuit performs nonlinear temperature calculation of the thermistor resistance-temperature relationship based on the read quantized thermistor resistance value and the Steinhart-Hart model parameters, and finally outputs the corrected temperature detection result Tcal.
[0051] Figure 6 This is a timing diagram of the high-precision thermistor temperature detection circuit of the present invention. Figure 6This invention is used to illustrate the timing relationship of each control signal within a complete working cycle and the collaborative working process between each functional module. The system completes one temperature detection in one working cycle, and each working cycle includes two working phases: drift error calibration mode and normal temperature measurement mode.
[0052] When the system enable signal EN switches from low to high, the system enters the working state, and the clock signal generation circuit 9 begins to output the clock signal required for normal system operation. Subsequently, when the rising edge of the working cycle start signal SET arrives, the control circuit 5 starts a new temperature detection working cycle and outputs mode enable control signals Cal1 and Cal2 according to the preset timing sequence. Specifically, when Cal1 is high and Cal2 is low, the system operates in drift error calibration mode; when Cal1 is low and Cal2 is high, the system operates in normal temperature measurement mode. The error comprehensive compensation calculation circuit 3 internally generates control signals Ctr1, Ctr2, and Ctr3 sequentially according to the system working state, respectively controlling the drift error calculation, drift compensation, and nonlinear temperature calculation processes to be executed according to the preset timing sequence.
[0053] Wherein, Dclk is the calibration control clock output from control circuit 5 to calibration signal generation circuit 4, used to control calibration signal generation circuit 4 to sequentially output each preset calibration voltage, and serves as the working clock of each functional module in drift error calibration mode and normal temperature measurement mode; Clk1 is the working clock of analog-to-digital converter (ADC), used to drive ADC to complete analog-to-digital conversion; Clk2 is the working clock of error comprehensive compensation calculation circuit 3, used to drive error comprehensive control circuit and each digital processing module to complete data calculation. For an N-bit successive approximation ADC, each analog-to-digital conversion requires N+2 Clk1 clock cycles. Therefore, each Dclk corresponds to N+2 Clk1 clock cycles, used to complete one complete digital sampling process.
[0054] Specifically, in drift error calibration mode, the control signal Cal1 is active, and the control circuit 5 outputs K+1 consecutive calibration control clocks Dclk. The first K Dclk clocks each correspond to a preset calibration voltage. Under the control of each Dclk clock, the calibration signal generation circuit 4 sequentially outputs K preset calibration voltages. The thermistor measurement circuit outputs the corresponding differential measurement signal, which is amplified by the programmable gain amplifier 1 and then sent to the analog-to-digital converter ADC. An analog-to-digital conversion is completed within N+2 Clk1 clock cycles, and the corresponding actual calibration digital code Dcal(j) is output.
[0055] Since drift error calculation is based on the completion of actual calibration digital code acquisition, the control signal Ctr1 generated by the error synthesis control circuit is delayed by one Dclk relative to the control signal Cal1. After the j-th group of actual calibration digital codes is acquired, Ctr1 enables the drift error calculation module in the next Dclk. Based on the actual calibration digital code Dcal(j), the address signal adr1 is generated through decoding. The drift error calibration data storage circuit 6 is accessed to read the reference digital code of the corresponding calibration temperature point, and the drift error err(j) of the j-th group is calculated. The above process is performed sequentially with each group of calibration voltages, completing a total of K groups of drift error calculations, realizing the pipelined processing of digital code acquisition and drift error calculation.
[0056] After the Kth drift error is calculated, the (K+1)th Dclk is used to complete the error fusion process. The error fusion module performs fusion calculations on the K groups of drift errors to generate a unique digital compensation code D corresponding to the current calibration temperature point. comp The digital compensation code is then written into the drift compensation register, thus ending the drift error calibration mode.
[0057] After drift error calibration is completed, control signal Cal1 becomes inactive, control signal Cal2 becomes active, and the system enters normal temperature measurement mode. Normal temperature measurement mode occupies 2 Dclk cycles, with each Dclk corresponding to N+2 Clk1 clock cycles. The thermistor measurement circuit outputs a differential measurement signal at the current ambient temperature. This signal is amplified by programmable gain amplifier 1 and then sent to the analog-to-digital converter (ADC) for analog-to-digital conversion, yielding the current measurement digital code Dtmp.
[0058] During the first Dclk cycle of normal temperature measurement mode, the error synthesis control circuit generates a control signal Ctr2, enabling the drift compensation module to start working. The drift compensation module reads the digital compensation code D stored in the drift compensation register. comp Drift error compensation is performed on the current measured digital code Dtmp to obtain the compensated digital code Dtcal.
[0059] Subsequently, within the second Dclk of the normal temperature measurement mode, the error synthesis control circuit generates a control signal Ctr3, enabling the nonlinear temperature calculation module to start working. The nonlinear temperature calculation module decodes the compensated digital code Dtcal to generate an address signal adr2, accesses the basic calibration data storage circuit 7, and reads the quantization thermistor resistance value R at the corresponding address. ntc Based on the quantized thermistor resistance value and the Steinhart-Hart model parameters A, B, and C corresponding to the temperature range, the nonlinear temperature solution of the thermistor resistance-temperature relationship is completed, and the corrected temperature detection result Tcal is finally output.
[0060] After completing the above processing, one working cycle ends. Control circuit 5 starts the next working cycle according to the preset control program, cyclically executing the drift error calibration mode and the normal temperature measurement mode to realize the periodic update of the long-term drift error of the thermistor and the real-time high-precision detection of temperature. The above working process continues until the system enable signal EN switches from high level to low level, at which point control circuit 5 stops outputting control signals and the working clock, and the system exits the working state.
[0061] The following is combined Figure 7 The specific implementation process of the drift error calibration method of the present invention is described below. This embodiment uses a 12-bit successive approximation analog-to-digital converter (SAR ADC) as an example, with a resolution of N=12 bits and a digital output range of 0 to 2. 12 -1, i.e., 0 to 4095. The ADC operating clock Clk1 is 1MHz. Each analog-to-digital conversion requires N+2=14 Clk1 clock cycles, so the conversion time is approximately 14µs. In this embodiment, one Dclk corresponds to one complete ADC analog-to-digital conversion process, i.e., each Dclk corresponds to N+2 Clk1 clock cycles. The calibration signal generation circuit outputs K=3 sets of preset calibration voltages, namely Vrcal(1)=1.2 V, Vrcal(2)=2.5 V and Vrcal(3)=3.3 V. Therefore, the drift error calibration mode occupies a total of K+1 Dclk cycles.
[0062] After the system enters the drift error calibration mode, the control circuit 5 outputs control signals Cal1=1 and Cal2=0. The control calibration signal generation circuit outputs three sets of calibration voltages in sequence and completes the acquisition of the corresponding digital codes. In this embodiment, the three sets of actual calibration digital codes obtained are Dcal(1)=2051, Dcal(2)=2053 and Dcal(3)=2055.
[0063] During drift error calculation, the error synthesis control circuit outputs a control signal Ctr1. Ctr1 is generated with a delay of one Dclk relative to Cal1, ensuring that the corresponding drift error calculation starts immediately after each group of actual calibration digital codes completes ADC conversion, achieving a pipelined processing of digital code acquisition and drift error calculation. The drift error calculation module generates an address signal adr1 based on the actual calibration digital code after decoding, and accesses the drift error calibration data storage circuit 6 to read the reference digital code Dref(i) corresponding to the current calibration temperature point. In this embodiment, the reference digital code corresponding to the current temperature point is set to Dref(i) = 2048.
[0064] Then, the drift error corresponding to each calibration voltage was calculated:
[0065] Calculated
[0066] The error fusion module uses the arithmetic mean method to calculate the overall drift error:
[0067] Further, the digital compensation code is obtained:
[0068] In this embodiment, ,therefore, .
[0069] Error comprehensive compensation calculation circuit 3 writes the digital compensation code into the drift compensation register and establishes the correspondence between the current calibration temperature point and the digital compensation code for use in normal temperature measurement mode. At this point, the drift error calibration process is complete.
[0070] According to the parameters in this embodiment, the drift error calibration mode occupies a total of 4 Dclk cycles. The first 3 Dclk cycles complete the acquisition of the digital codes corresponding to the 3 sets of calibration voltages, respectively. The 4th Dclk cycle completes the final set of drift error calculation, error fusion, and writing of the digital compensation code into the drift compensation register. Since the drift error calculation and digital code acquisition adopt a pipelined processing method, the drift error calibration efficiency and system real-time performance are effectively improved.
[0071] After the system completes drift error calibration, it enters normal temperature measurement mode, such as... Figure 8 The diagram shows the workflow of the normal temperature measurement mode of this invention. At this time, the system control circuit 5 outputs control signals Cal1=0 and Cal2=1, disabling the drift error calibration function and enabling the basic calibration function. The normal temperature measurement mode occupies a total of 2 Dclk cycles, with each Dclk corresponding to N+2 Clk1 clock cycles.
[0072] The thermistor measurement circuit outputs differential measurement signals Vrt1 and Vrt2 at the current ambient temperature. These signals are amplified by programmable gain amplifier 1 to obtain the differential output signal Vdiff, which is then fed into a 12-bit successive approximation analog-to-digital converter (ADC) to complete the analog-to-digital conversion and obtain the current measurement digital code D. tmp In this embodiment, it is assumed that the current measurement digital code output by the ADC is:
[0073] During the first Dclk in normal temperature measurement mode, the error comprehensive control circuit outputs control signal Ctr2, enabling the drift compensation module to start working. The drift compensation module first reads the digital compensation code stored in the drift compensation register. Since the digital compensation code corresponding to the current calibration temperature point has already been obtained during the drift error calibration stage, it is as follows:
[0074] Therefore, the drift compensation module completes drift error compensation according to the following formula:
[0075] Substituting the data from this example, we get:
[0076] That is, the digital code after drift error compensation is 2051.
[0077] Subsequently, during the second Dclk cycle of the normal temperature measurement mode, the error synthesis control circuit outputs control signal Ctr3, enabling the nonlinear temperature calculation module to start working. The nonlinear temperature calculation module decodes the compensated digital code Dtcal to generate address signal adr2, accesses the basic calibration data storage circuit 7, and reads the quantized thermistor resistance value R stored at the corresponding address. ntc And the Steinhart-Hart model parameters A, B, and C for the corresponding temperature range. In this embodiment, it is assumed that the resistance value of the quantization thermistor corresponding to the compensated digital code 2051 is:
[0078] The Steinhart-Hart model parameters for the corresponding temperature ranges are as follows:
[0079]
[0080]
[0081] The nonlinear temperature calculation module uses the parameters to perform temperature calculations according to the Steinhart-Hart model, the expression of which is:
[0082] Where T is the thermodynamic temperature, in Kelvin (K). Further, the Celsius temperature can be obtained:
[0083] Substituting the above parameters into the calculation, the current measured temperature is approximately:
[0084] Finally, the error comprehensive compensation calculation circuit 3 outputs the corrected temperature detection result and completes the normal temperature measurement process.
[0085] According to the parameters of this embodiment, the normal temperature measurement mode occupies two Dclk cycles. The first Dclk is used to compensate for the drift error of the ADC digital code, and the second Dclk is used to perform the nonlinear temperature calculation of the thermistor resistance-temperature relationship. Therefore, the entire normal temperature measurement process takes approximately 200 ns. Since the drift error compensation and nonlinear temperature calculation are performed sequentially, this invention can not only effectively compensate for the digital code drift generated during long-term operation of the thermistor, but also correct the nonlinear error of the thermistor resistance-temperature relationship, thereby obtaining high-precision and high-reliability temperature detection results.
[0086] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A high-precision thermistor temperature detection circuit, comprising a differential temperature detection circuit consisting of thermistors Rntc1 and Rntc2, voltage divider resistors Rm1 and Rm2, and a programmable gain amplifier (1), characterized in that, It also includes an analog-to-digital converter (2), an error comprehensive compensation calculation circuit (3), a calibration signal generation circuit (4), a control circuit (5), a drift error calibration data storage circuit (6), a basic calibration data storage circuit (7), a program memory (8), and a clock signal generation circuit (9); The upper ends of thermistors Rntc1 and Rntc2 are connected to the calibration voltage Vrcal output by the calibration signal generation circuit (4). The lower end of thermistor Rntc1 is connected to the upper end of the voltage divider resistor Rm1 and the inverting input of the programmable gain amplifier (1), and outputs the temperature detection voltage Vrt1. The lower end of thermistor Rntc2 is connected to the upper end of the voltage divider resistor Rm2 and the non-inverting input of the programmable gain amplifier (1), and outputs the temperature detection voltage Vrt2. The lower ends of the voltage divider resistors Rm1 and Rm2 are grounded. The output of the programmable gain amplifier (1) is connected in sequence to the analog-to-digital converter (2) and the error comprehensive compensation calculation circuit (3); the error comprehensive compensation calculation circuit (3) is connected to the data output terminal dat1 and address input terminal adr1 of the drift error calibration data storage circuit (6) and the data output terminal dat2 and address input terminal adr2 of the basic calibration data storage circuit (7); The program memory (8) is connected to the control circuit (5). The control circuit (5) generates control signals according to the control program in the program memory (8), which are respectively connected to the calibration signal generation circuit (4), the drift error calibration data storage circuit (6), the basic calibration data storage circuit (7), the error comprehensive compensation calculation circuit (3), and the clock signal generation circuit (9) to control the switching of the system's working mode and the coordinated operation of each functional module. The clock signal generation circuit (9) is used to generate the clock signal required for normal system operation during the period when the system enable signal is valid; The base calibration data storage circuit (7) stores the quantized thermistor resistance value R ntc and the corresponding temperature interval Steinhart-Hart model parameters, the storage content of which is: {adr2(i), R ntc (i), A i , B i , C i} wherein adr2(i) represents the i-th memory address, R ntc (i) represents the quantized thermistor resistance value at the corresponding address, A i , B i , and C i represent the Steinhart-Hart model parameters for the corresponding temperature interval, respectively. The error comprehensive compensation calculation circuit (3) has two working modes: drift error calibration mode and normal temperature measurement mode. In the drift error calibration mode, the address signal adr1 is generated according to the actual calibration digital code output by the analog-to-digital converter (2), the drift error calibration data storage circuit (6) is accessed to read the reference digital code of the corresponding calibration temperature point, the drift error corresponding to multiple calibration voltages is calculated and the error is fused, a unique digital compensation code corresponding to the current calibration temperature point is generated and written into the drift compensation register. In the normal temperature measurement mode, the digital compensation code in the drift compensation register is read to complete the drift error compensation, and then the address signal adr2 is generated according to the compensated digital code, the basic calibration data storage circuit (7) is accessed to read the corresponding quantized thermistor resistance value and Steinhart-Hart model parameters, the nonlinear temperature solution of the thermistor resistance value and temperature relationship is completed, and the final temperature detection result is output.
2. The high-precision thermistor temperature detection circuit according to claim 1, characterized in that, The drift error calibration data storage circuit (6) stores the reference digital code corresponding to each calibration temperature point in an address index manner. Its storage content is as follows: {adr1(i), Dref(i)} Where adr1(i) represents the i-th storage address, and Dref(i) represents the reference digital code corresponding to the calibration temperature point.
3. The high-precision thermistor temperature detection circuit according to claim 2, characterized in that, The error comprehensive compensation calculation circuit (3) includes a drift error calculation module, a drift compensation module, a nonlinear temperature calculation module, and an error comprehensive control circuit; the error comprehensive control circuit generates control signals Ctr1, Ctr2, and Ctr3 to control the drift error calculation module, the drift compensation module, and the nonlinear temperature calculation module to work according to a preset timing sequence. The drift error calculation module calculates the drift error err(j) based on the actual calibration digital code Dcal(j) and the reference digital code Dref(i) corresponding to each calibration voltage Vrcal(j), and fuses multiple drift errors to obtain a comprehensive drift error. This is then used to generate a unique digital compensation code D corresponding to the current calibration temperature point. comp Write it to its own drift compensation register, where err(j) represents the drift error of the j-th group; The digital compensation code D comp In normal temperature measurement mode, the drift compensation module reads the measurement digital code Dtmp output by the analog-to-digital converter (2) and performs drift error compensation to obtain the compensated digital code Dtcal. The nonlinear temperature calculation module generates an address signal adr2 based on the compensated digital code Dtcal to access the basic calibration data storage circuit (7) to read the corresponding quantized thermistor resistance value and Steinhart-Hart model parameters, and completes the nonlinear temperature calculation of the relationship between thermistor resistance value and temperature based on the Steinhart-Hart model, and outputs the temperature detection result Tcal.
4. The high-precision thermistor temperature detection circuit according to claim 1, characterized in that, The clock signal generation circuit (9) generates signals including calibration control clock Dclk, analog-to-digital converter (2) working clock Clk1 and error comprehensive compensation calculation circuit (3) working clock Clk2, so as to ensure that calibration signal generation circuit (4), analog-to-digital converter (2) and error comprehensive compensation calculation circuit (3) operate in a coordinated manner according to the preset timing sequence.
5. The high-precision thermistor temperature detection circuit according to claim 4, characterized in that, The drift error calibration mode occupies a total of K+1 control clocks Dclk, where the first K Dclk correspond to the acquisition of digital codes under K calibration voltages, and the K+1 Dclk is used to complete the last set of drift error calculation, error fusion and writing of digital compensation codes into the drift compensation register; the normal temperature measurement mode occupies 2 Dclk, where the first Dclk completes drift compensation and the second Dclk completes nonlinear temperature calculation.
6. A temperature detection method based on the high-precision thermistor temperature detection circuit according to any one of claims 1 to 5, characterized in that, Includes the following steps: S1, Control circuit (5) controls the system to enter the drift error calibration mode, calibration signal generation circuit (4) outputs multiple preset calibration voltages in sequence, and analog-to-digital converter (2) obtains the corresponding actual calibration digital code respectively. S2, Error Comprehensive Compensation Calculation Circuit (3) Generates address signal adr1 based on actual calibration digital code, accesses drift error calibration data storage circuit (6) based on address signal adr1, reads reference digital code of corresponding calibration temperature point, calculates drift error corresponding to multiple calibration voltages, performs error fusion, generates digital compensation code uniquely corresponding to the current calibration temperature point, and writes it into drift compensation register. S3, control circuit (5) controls the system to enter normal temperature measurement mode, analog-to-digital converter (2) outputs the current measurement digital code, reads the digital compensation code in the drift compensation register to complete the drift error compensation, and obtains the compensated digital code; S4. Generate address signal adr2 based on the compensated digital code, access the basic calibration data storage circuit (7) based on address signal adr2 to read the corresponding quantized thermistor resistance value and Steinhart-Hart model parameters, and complete the nonlinear temperature calculation of the thermistor resistance value and temperature relationship based on the Steinhart-Hart model, and output the final temperature detection result.
7. The temperature detection method according to claim 6, characterized in that, The control circuit (5) generates a system enable signal EN, a working cycle start signal SET, and mode enable control signals Cal1 and Cal2 according to the control program in the program memory (8). The system enable signal EN is used to control the start and stop of the entire temperature detection circuit. The working cycle start signal SET is used to start a new temperature detection working cycle. The mode enable control signals Cal1 and Cal2 are used to enable the drift error calibration process and the normal temperature measurement process, respectively, so as to realize that each functional module works in coordination according to the preset timing.
8. The temperature detection method according to claim 7, characterized in that, In step S2, the drift error calculation adopts a pipelined processing method. The control signal Ctr1 is generated with a delay of one control clock Dclk relative to the control signal Cal1, so that the corresponding drift error is calculated immediately after each group of actual calibration digital codes completes analog-to-digital conversion, and the error fusion and digital compensation code generation are completed within the last control clock.
