Method and system for improving precision of temperature sensor
By generating the reference curve VREF(T) and nonlinear compensation of the relationship between PTAT code and temperature, the problem of nonlinearity of PTAT code curve in existing temperature sensors is solved, improving the accuracy of the temperature sensor and improving the testing efficiency.
Patent Information
- Application Number
- CN202411785001.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-18
AI Technical Summary
The existing temperature sensors have nonlinearity in the curve of PTAT code with temperature change, resulting in a decrease in measurement accuracy, especially when the temperature changes are large.
The PTAT voltage and CTAT voltage are output through the temperature sensor circuit, and the analog-to-digital converter is used to convert it into a digital code, and the PTAT code and CTAT code at the first temperature T1 and the second temperature T2 are determined, and the reference curve VREF(T) is generated, and the relationship curve between the PTAT code and the temperature is nonlinearly compensated according to VREF(T).
Through nonlinear compensation, the accuracy of the temperature sensor is improved, the temperature error is reduced, and external calculations are performed only by measuring PTAT code and CTAT code at low and high temperatures, which greatly improves the testing efficiency.
Smart Images

Figure CN119642989A_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the field of temperature sensor technology. In particular, the present invention relates to a method and system for improving the accuracy of a temperature sensor. Background Art
[0002] A temperature sensor is a device that can convert temperature signals into electrical signals. Figure 1 FIG. 1 shows a schematic diagram of a module of a temperature sensor in the prior art. Figure 1 As shown, the existing temperature sensor usually outputs a voltage proportional to the temperature (PTAT voltage) by the temperature sensor circuit. After the voltage signal is processed by the analog-to-digital converter (ADC), a digital code proportional to the temperature (PTAT code) is generated. The value of the digital code directly reflects the current temperature.
[0003] Ideally, the curve of PTAT code changing with temperature should be a straight line, that is, the higher the temperature, the larger the PTAT code, and the two are linearly related. However, in actual temperature sensors, due to the influence of factors such as the characteristics of the device itself and the manufacturing process, the curve of PTAT code changing with temperature often has a certain degree of nonlinearity.
[0004] This nonlinearity will directly affect the measurement accuracy of the temperature sensor. Specifically, when the PTAT code curve is nonlinear, the correspondence between the digital code output by the sensor and the actual temperature will deviate, resulting in errors in the measurement results. This error is particularly obvious when the temperature changes greatly. Summary of the invention
[0005] In order to at least partially solve the above problems in the prior art, the present invention provides a method for improving the accuracy of a temperature sensor, comprising the following steps:
[0006] The temperature sensor circuit outputs the PTAT voltage and the CTAT voltage according to the temperature;
[0007] Converting the PTAT voltage into a PTAT code and converting the CTAT voltage into a CTAT code by an analog-to-digital converter;
[0008] Determine a PTAT code and a CTAT code at a first temperature T1 and a second temperature T2, wherein the first temperature T1 is less than the second temperature T2;
[0009] Generate a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2; and
[0010] The nonlinear compensation is performed on the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T).
[0011] In one embodiment of the present invention, generating a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2 includes:
[0012] The PTAT code at the first temperature T1 is represented as P1, the PTAT code at the second temperature T2 is represented as P2, the CTAT code at the first temperature T1 is represented as C1, and the CTAT code at the second temperature T2 is represented as C2;
[0013] The slope of the PTAT code versus temperature curve P(T) is expressed as follows: (P2-P1) / (T2-T1);
[0014] The slope of the curve C(T) of the relationship between the CTAT code and temperature is expressed as follows: (C2-C1) / (T2-T1);
[0015] The PTAT code vs. temperature curve P(T) and the CTAT code vs. temperature curve C(T) are combined to generate a reference curve VREF(T), which is expressed as follows:
[0016] VREF(T)=P(T)+(P1-P2) / (C2-C1)*C(T).
[0017] In one embodiment of the present invention, it is provided that the nonlinear compensation of the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T) comprises:
[0018] The relationship curve P(T) between the PTAT code and the temperature is processed by the reference curve VREF(T), which is expressed as the following formula:
[0019] as well as
[0020] The slope of the reference curve VREF(T) is fine-tuned, which is expressed as follows:
[0021]
[0022] Among them, α represents the fine-tuning coefficient.
[0023] In one embodiment of the present invention, it is provided that performing nonlinear compensation on the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T) further comprises:
[0024] According to the nonlinear relationship between P(T) and temperature, P(T) is expressed as follows:
[0025] P(T)=A1+A2T+A3T 2 ;
[0026] Introducing a primary temperature coefficient into VREF(T), VREF(T) is expressed as follows:
[0027] VREF(T)=B1+B2T
[0028] Among them, A1, A2, A3, B1, B2 are constants; and
[0029] P(T) / VREF(T) is expanded by Taylor series and expressed as follows:
[0030] P(T) / VREF(T)=
[0031]
[0032] The third and higher terms are ignored to offset the quadratic nonlinearity, thereby compensating for the nonlinearity of P(T).
[0033] The present invention also provides a system for improving the accuracy of a temperature sensor, comprising:
[0034] a temperature sensor circuit configured to output a PTAT voltage and a CTAT voltage according to temperature;
[0035] an analog-to-digital converter configured to convert the PTAT voltage into a PTAT code and to convert the CTAT voltage into a CTAT code; and
[0036] A nonlinear compensation module is configured to perform the following actions:
[0037] Determine a PTAT code and a CTAT code at a first temperature T1 and a second temperature T2, wherein the first temperature T1 is less than the second temperature T2;
[0038] Generate a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2; and
[0039] The nonlinear compensation is performed on the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T).
[0040] The present invention also provides a temperature sensor system, comprising:
[0041] a temperature sensor configured to measure temperature; and
[0042] A controller is configured to execute the method to improve the accuracy of the temperature sensor.
[0043] The present invention has at least the following beneficial effects: The present invention proposes a method and system for improving the accuracy of a temperature sensor, which can compensate for the nonlinearity of a temperature curve, thereby improving the accuracy of the temperature sensor. In addition, the present invention only needs to measure the PTAT code and CTAT code at a low temperature (a first temperature T1) and a high temperature (a second temperature T2), and can calculate the reference curve VREF(T) outside the sensor for nonlinear compensation, which can greatly improve the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] To further illustrate the advantages and features of various embodiments of the present invention, a more detailed description of various embodiments of the present invention will be presented with reference to the accompanying drawings. It will be understood that these drawings only depict typical embodiments of the present invention and are therefore not to be considered as limiting the scope thereof. In the accompanying drawings, for clarity, identical or corresponding parts will be represented by identical or similar reference numerals.
[0045] Figure 1 A module schematic diagram of a temperature sensor in the prior art is shown.
[0046] Figure 2 A schematic flow chart of a method for improving the accuracy of a temperature sensor according to an embodiment of the present invention is shown.
[0047] Figure 3 A schematic diagram of a module of a temperature sensor according to an embodiment of the present invention is shown.
[0048] FIG. 4 is a schematic diagram showing a temperature-digital code curve according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] It should be noted that the components in the figures may be shown exaggeratedly for the sake of illustration and are not necessarily true to scale. In the figures, identical or functionally identical components are provided with the same reference numerals.
[0050] In the present invention, unless otherwise specified, "arranged on...", "arranged above..." and "arranged above..." do not exclude the existence of an intermediate between the two. In addition, "arranged on or above..." merely indicates the relative positional relationship between two components, and in certain cases, such as after reversing the product direction, it can also be converted into "arranged below or below...", and vice versa.
[0051] In the present invention, each embodiment is only intended to illustrate the aspects of the present invention and should not be construed as limiting.
[0052] In the present invention, unless otherwise specified, the quantifiers "a", "an" and "an" do not exclude the presence of a plurality of elements.
[0053] It should also be noted that in the embodiments of the present invention, for the sake of clarity and simplicity, only a portion of the parts or components may be shown, but those of ordinary skill in the art will understand that under the teachings of the present invention, the required parts or components may be added according to the needs of the specific scenario. In addition, unless otherwise specified, the features in different embodiments of the present invention may be combined with each other. For example, a feature in the second embodiment may be used to replace a corresponding or functionally identical or similar feature in the first embodiment, and the resulting embodiment also falls within the disclosure scope or recorded scope of the present application.
[0054] It should also be noted that within the scope of the present invention, the terms "same", "equal", "equal to" and the like do not mean that the values of the two are absolutely equal, but allow a certain reasonable error, that is, the terms also cover "substantially the same", "substantially equal", "substantially equal to". By analogy, in the present invention, the terms "perpendicular to", "parallel to" and the like indicating directions also cover the meanings of "substantially perpendicular to" and "substantially parallel to".
[0055] In the present application, the term "configuration" refers to the setting of the shape, structure, material and / or function of the target object to achieve the desired technical effect, wherein "configuration" includes a variety of alternative technical means for achieving the technical effect, which become obvious under the teaching of the present application.
[0056] In addition, the numbering of the steps of the methods of the present invention does not limit the execution order of the method steps. Unless otherwise specified, the method steps can be executed in different orders.
[0057] The present invention will be further described below in conjunction with specific embodiments with reference to the accompanying drawings.
[0058] Figure 2 FIG. 2 is a flow chart showing a method for improving the accuracy of a temperature sensor according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0059] Step 201: The temperature sensor circuit outputs a PTAT voltage and a CTAT voltage according to the temperature.
[0060] Step 202: The analog-to-digital converter converts the PTAT voltage into a PTAT code, and converts the CTAT voltage into a CTAT code.
[0061] Step 203: Determine the PTAT code and the CTAT code at a first temperature T1 and a second temperature T2, wherein the first temperature T1 is lower than the second temperature T2.
[0062] Step 204: Generate a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2.
[0063] Step 205: Perform nonlinear compensation on the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T).
[0064] Figure 3 A schematic diagram of a module of a temperature sensor according to an embodiment of the present invention is shown. The method for improving the accuracy of a temperature sensor is specifically described below in conjunction with the temperature sensor.
[0065] like Figure 3 As shown, the temperature sensor includes a temperature sensor circuit 301 and an analog-to-digital converter 302 (ADC). The temperature sensor circuit 301 outputs a voltage proportional to the temperature (PTAT voltage) and a voltage inversely proportional to the temperature (CTAT voltage). After the two voltages are converted by the analog-to-digital converter 302, a digital code proportional to the temperature (PTAT code) and a digital code inversely proportional to the temperature (CTAT code) are generated.
[0066] During the test, the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2 are first determined, wherein the first temperature T1 is lower than the second temperature T2. Fig. 4 shows a schematic diagram of a temperature-digital code curve according to an embodiment of the present invention.
[0067] As shown in FIG4 , the PTAT code at the first temperature T1 is represented as P1, the PTAT code at the second temperature T2 is represented as P2, the CTAT code at the first temperature T1 is represented as C1, the CTAT code at the second temperature T2 is represented as C2, the slope of the PTAT code and temperature curve P(T) is represented as (P2-P1) / (T2-T1), and the slope of the CTAT code and temperature curve C(T) is represented as (C2-C1) / (T2-T1). By combining P(T) and C(T), a reference curve VREF(T) whose size is independent of temperature can be obtained, which is expressed as the following formula:
[0068] VREF(T)=P(T)+(P1-P2) / (C2-C1)*C(T).
[0069] Since P(T) is positively correlated with temperature, P(T) / VREF(T) is also positively correlated with temperature, as shown in the following formula:
[0070]
[0071] By fine-tuning the slope of VREF(T), VREF(T) can be turned into a curve with a slight temperature coefficient, expressed as follows:
[0072]
[0073] Among them, α represents the fine-tuning coefficient.
[0074] Since the relationship between P(T) and temperature is actually nonlinear, P(T) can be expressed as follows:
[0075] P(T)=A1+A2T+A3T 2
[0076] Furthermore, a primary temperature coefficient is introduced into VREF(T), and VREF(T) is expressed as follows:
[0077] VREF(T)=B1+B2T
[0078] Among them, A1, A2, A3, B1, and B2 are all constants.
[0079] P(T) / VREF(T) is expanded by Taylor series and expressed as follows:
[0080]
[0081] In the above formula, the third and higher terms are ignored. The above steps can offset the quadratic nonlinearity, so VREF(T) can compensate for the nonlinearity of P(T).
[0082] In one embodiment of the present invention, a system for improving the accuracy of a temperature sensor is provided, which includes: a temperature sensor circuit, an analog-to-digital converter, and a nonlinear compensation module.
[0083] The temperature sensor circuit is configured to output a PTAT voltage and a CTAT voltage according to the temperature.
[0084] The analog-to-digital converter is configured to convert the PTAT voltage into a PTAT code and convert the CTAT voltage into a CTAT code.
[0085] The nonlinear compensation module is configured to perform the following actions: determine the PTAT code and the CTAT code at a first temperature T1 and a second temperature T2, wherein the first temperature T1 is less than the second temperature T2; generate a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2; and perform nonlinear compensation on a curve P(T) of the relationship between the PTAT code and the temperature according to the reference curve VREF(T).
[0086] The present invention only needs to measure the PTAT code and CTAT code at low temperature (first temperature T1) and high temperature (second temperature T2), and then calculate externally to obtain VREF (T). Due to differences in process and model deviation, the specific fine-tuning coefficient needs to be determined after batch testing.
[0087] In the prior art, when compensating for the nonlinearity of the temperature curve, it is necessary to generate a bandgap reference voltage in the circuit, adjust the slope of the bandgap reference voltage by trimming the bandgap reference voltage, calculate the temperature error once for each trimming step, and then find the trimming code with the smallest temperature error from all trimming codes, which greatly increases the workload of the test.
[0088] In contrast, according to the present invention, only the PTAT code and CTAT code at low temperature and high temperature need to be measured to perform nonlinear compensation on the PTAT code. Figure 4A Figure 2 shows a graph of temperature error when no slope trimming is performed on VREF(T). Figure 4B FIG. 1 shows a schematic diagram of temperature error after VREF(T) is fine-tuned according to the method of the present invention, wherein the same slope fine-tuning coefficient is used under all conditions. Figure 4A and Figure 4B It can be seen that the temperature error is improved from ±0.8℃ to ±0.25℃.
[0089] Although various embodiments of the present invention are described above, it should be understood that they are presented as examples only and not as limitations. It is obvious to those skilled in the relevant art that various combinations, modifications and changes can be made thereto without departing from the spirit and scope of the present invention. Therefore, the breadth and scope of the present invention disclosed herein should not be limited by the exemplary embodiments disclosed above, but should only be defined according to the attached claims and their equivalents.
Claims
1. A method for improving the accuracy of a temperature sensor, characterized in that: The following steps are involved: The temperature sensor circuit outputs the PTAT voltage and the CTAT voltage according to the temperature; Converting the PTAT voltage into a PTAT code and converting the CTAT voltage into a CTAT code by an analog-to-digital converter; Determine a PTAT code and a CTAT code at a first temperature T1 and a second temperature T2, wherein the first temperature T1 is less than the second temperature T2; Generate a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2; as well as The nonlinear compensation is performed on the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T).
2. The method for improving the accuracy of a temperature sensor according to claim 1, characterized in that: Generating a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2 includes: The PTAT code at the first temperature T1 is represented as P1, the PTAT code at the second temperature T2 is represented as P2, the CTAT code at the first temperature T1 is represented as C1, and the CTAT code at the second temperature T2 is represented as C2; The slope of the PTAT code versus temperature curve P(T) is expressed as follows: (P2-P1) / (T2-T1); The slope of the CTAT code vs. temperature curve C(T) is expressed as: (C2-C1) / (T2-T1): The PTAT code vs. temperature curve P(T) and the CTAT code vs. temperature curve C(T) are combined to generate a reference curve VREF(T), which is expressed as follows: VREF(T)=P(T)+(P1-P2) / (C2-C1)*C(T).
3. The method for improving the accuracy of a temperature sensor according to claim 2, characterized in that: The nonlinear compensation of the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T) comprises: The relationship curve P(T) between the PTAT code and the temperature is processed by the reference curve VREF(T), which is expressed as the following formula: as well as The slope of the reference curve VREF(T) is fine-tuned, which is expressed as follows: Among them, α represents the fine-tuning coefficient.
4. The method for improving the accuracy of a temperature sensor according to claim 3, characterized in that: The nonlinear compensation of the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T) also includes: According to the nonlinear relationship between P(T) and temperature, P(T) is expressed as follows: P(T)=A1+A2T+A3T 2 ; Introducing a primary temperature coefficient into VREF(T), VREF(T) is expressed as follows: VREF(T)=B1+B2T Among them, A1, A2, A3, B1, B2 are constants; and P(T) / VREF(T) is expanded by Taylor series and expressed as follows: The third and higher terms are ignored to offset the quadratic nonlinearity, thereby compensating for the nonlinearity of P(T).
5. A system for improving the accuracy of a temperature sensor, characterized in that: include: a temperature sensor circuit configured to output a PTAT voltage and a CTAT voltage according to temperature; an analog-to-digital converter configured to convert the PTAT voltage into a PTAT code and convert the CTAT voltage into a CTAT code; as well as A nonlinear compensation module is configured to perform the following actions: Determine a PTAT code and a CTAT code at a first temperature T1 and a second temperature T2, wherein the first temperature T1 is less than the second temperature T2; Generate a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2; as well as The nonlinear compensation is performed on the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T).
6. The system for improving the accuracy of a temperature sensor according to claim 5, characterized in that: Generating a reference curve VREF(T) according to the PTAT code and the CTAT code at the first temperature T1 and the second temperature T2 includes: The PTAT code at the first temperature T1 is represented as P1, the PTAT code at the second temperature T2 is represented as P2, the CTAT code at the first temperature T1 is represented as C1, and the CTAT code at the second temperature T2 is represented as C2; The slope of the PTAT code versus temperature curve P(T) is expressed as follows: (P2-P1) / (T2-T1); The slope of the curve C(T) of the relationship between the CTAT code and temperature is expressed as follows: (C2-C1) / (T2-T1); The PTAT code vs. temperature curve P(T) and the CTAT code vs. temperature curve C(T) are combined to generate a reference curve VREF(T), which is expressed as follows: VREF(T)=P(T)+(P1-P2) / (C2-C1)*C(T).
7. The system for improving the accuracy of a temperature sensor according to claim 6, characterized in that: The nonlinear compensation of the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T) comprises: The relationship curve P(T) between the PTAT code and the temperature is processed by the reference curve VREF(T), which is expressed as the following formula: as well as The slope of the reference curve VREF(T) is fine-tuned, which is expressed as follows: Among them, α represents the fine-tuning coefficient.
8. The system for improving the accuracy of a temperature sensor according to claim 7, characterized in that: The nonlinear compensation of the relationship curve P(T) between the PTAT code and the temperature according to the reference curve VREF(T) also includes: According to the nonlinear relationship between P(T) and temperature, P(T) is expressed as follows: P(T)=A1+A2T+A3T 2 ; Introducing a primary temperature coefficient into VREF(T), VREF(T) is expressed as follows: VREF(T)=B1+B2T Among them, A1, A2, A3, B1, B2 are constants; and P(T) / VREF(T) is expanded by Taylor series and expressed as follows: The third and higher terms are ignored to offset the quadratic nonlinearity, thereby compensating for the nonlinearity of P(T).
9. A temperature sensor system, characterized in that: include: a temperature sensor configured to measure temperature; as well as A controller configured to execute the method according to any one of claims 1-4 to improve the accuracy of the temperature sensor.