Temperature determination method and circuit, and electronic device
By determining the resolution of the analog-to-digital converter and the resistance value of the thermocouple, and calculating the voltage difference and absolute voltage, high-precision thermocouple temperature measurement is achieved, solving the accuracy and response time problems of the thermocouple in high-temperature environments.
Patent Information
- Application Number
- CN202411411390.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-12-20
AI Technical Summary
The existing thermocouples have poor temperature measurement accuracy and long response time in high-temperature environments, which cannot meet the needs of high-precision testing.
The resolution of the analog-to-digital converter is determined by determining the maximum gain and external reference voltage of the analog-to-digital converter, and the voltage difference and absolute voltage are calculated using the voltage signal collected by the thermocouple and the resistance value of the reference joint point, thereby accurately determining the measurement of the thermocouple. temperature.
The temperature measurement accuracy of the thermocouple in high temperature environments is improved, and the problem of poor temperature accuracy is solved.
Smart Images

Figure CN119164510A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent monitoring, and more specifically, to a method for determining temperature, a circuit, and an electronic device. Background Art
[0002] In the fields of industrial production, intelligent processing and wearable electronic devices, the demand for temperature detection is getting higher and higher. Thermocouples are commonly used temperature sensors in temperature measurement. Their main advantages are wide detection range and adaptability to various atmospheric environments. Moreover, they are durable, low-priced, and do not require power supply. They are widely used in industrial environments. The commonly used thermocouple types on the market are as follows: B-type, R-type, S-type, K-type, J-type, T-type, E-type, N-type, C-type, etc. The temperature measurement range and acquisition accuracy of each type of thermocouple are also different. Users choose the corresponding suitable type of thermocouple according to their actual needs. Usually, a thermocouple acquisition module can support multiple different types of thermocouples. However, in practical applications, especially in high temperature environments suitable for thermocouple temperature measurement, the acquisition accuracy of different thermocouples varies greatly, and the response time is long. In the process of realizing this application, the inventor found that there are at least the following problems in the prior art: when the module uses thermocouples to collect temperature, the accuracy is poor, the response time is long, and it does not meet certain special high-precision test demand scenarios; there is a problem that the test accuracy of different thermocouples varies greatly.
[0003] With regard to the related technology, there is no effective solution to the problem of poor temperature accuracy collected by thermocouples.
[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention
[0005] The embodiments of the present application provide a method, circuit, and electronic device for determining temperature, so as to at least solve the problem of poor temperature accuracy collected by thermocouples.
[0006] According to one aspect of an embodiment of the present application, a method for determining temperature is provided, comprising: determining the resolution of the analog-to-digital converter according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, wherein the maximum gain is determined according to the thermocouple corresponding to the analog-to-digital converter; determining the pressure difference according to a first digital signal output by the analog-to-digital converter, and determining the code value corresponding to the first resistor according to a second digital signal output by the analog-to-digital converter, wherein the first digital signal is determined by the analog-to-digital converter according to the resolution and the first voltage signal collected by the thermocouple, and the pressure difference is the pressure difference between the measurement junction and the reference junction of the thermocouple; determining the first absolute voltage of the reference junction of the thermocouple; determining the second absolute voltage of the measurement junction of the thermocouple according to the pressure difference and the first absolute voltage, and determining the first temperature of the measurement junction of the thermocouple according to the second absolute voltage.
[0007] In an exemplary embodiment, the resolution of the analog-to-digital converter is determined based on the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, including: determining the maximum voltage allowed to be collected by the thermocouple; calculating a first ratio of the external reference voltage and the maximum voltage, and using the first ratio as the maximum gain; determining the resolution based on the maximum gain and the sampling rate of the analog-to-digital converter, wherein the resolution corresponds to the maximum gain and the sampling rate.
[0008] In an exemplary embodiment, determining a first absolute voltage of a reference junction of the thermocouple includes: determining a code value corresponding to a first resistor according to a second digital signal output by the analog-to-digital converter, wherein the second digital signal is determined by the analog-to-digital converter according to a second voltage signal of a first resistor of a cold-end compensation circuit corresponding to the analog-to-digital converter, the first resistor is connected to an end of a compensation wire of the thermocouple, and the first resistor is a temperature acquisition element of the reference junction of the thermocouple; determining a first absolute voltage of the reference junction of the thermocouple according to the code value.
[0009] In an exemplary embodiment, determining a first absolute voltage of a reference junction of the thermocouple according to the code value includes: determining a reference code value corresponding to a reference digital signal, wherein the reference digital signal is determined by the analog-to-digital converter according to a reference voltage signal corresponding to a reference resistor; and determining the first absolute voltage according to the reference code value, the code value, and a first resistance value of the reference resistor.
[0010] In an exemplary embodiment, determining the first absolute voltage based on the reference code value, the code value, and a first resistance value of the reference resistor includes: calculating a second ratio of the code value to the reference code value; calculating a product of the second ratio and the first resistance value of the reference resistor, and using the product as a second resistance value of the first resistor; and determining the first absolute voltage based on the second resistance value.
[0011] In an exemplary embodiment, determining the first absolute voltage according to the second resistance value includes: determining the second temperature of the reference junction corresponding to the second resistance value according to first table information, wherein the first table information stores the correspondence between the resistance value of the first resistor and the temperature of the reference junction; and determining the first absolute voltage corresponding to the second temperature according to second table information, wherein the second table information stores the correspondence between the temperature of the reference junction and the voltage of the reference junction.
[0012] According to another aspect of an embodiment of the present application, a temperature determination circuit is also provided, comprising: a thermocouple acquisition circuit, an analog-to-digital converter connected to the thermocouple acquisition circuit, and a processor connected to the analog-to-digital converter, wherein the processor is used to determine the resolution of the analog-to-digital converter according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, wherein the maximum gain is determined according to the thermocouple in the thermocouple acquisition circuit; the thermocouple acquisition circuit is used to input the first voltage signal acquired by the thermocouple into the analog-to-digital converter; the analog-to-digital converter is used to determine the first digital signal corresponding to the voltage signal according to the resolution; the processor is also used to determine the pressure difference according to the first digital signal; determine the first absolute voltage of the reference junction of the thermocouple; determine the second absolute voltage of the measurement junction of the thermocouple according to the pressure difference and the first absolute voltage, and determine the first temperature of the measurement junction of the thermocouple according to the second absolute voltage, wherein the pressure difference is the pressure difference between the measurement junction and the reference junction of the thermocouple.
[0013] In an exemplary embodiment, the processor is further used to determine the maximum voltage allowed to be collected by the thermocouple; calculate a first ratio of the external reference voltage and the maximum voltage, and use the first ratio as the maximum gain; determine the resolution based on the maximum gain and the sampling rate of the analog-to-digital converter, wherein the resolution corresponds to the maximum gain and the sampling rate.
[0014] In an exemplary embodiment, it also includes: a cold-end compensation circuit connected to the analog-to-digital converter, wherein the cold-end compensation circuit is used to input a second voltage signal corresponding to the first resistor into the analog-to-digital converter, wherein the first resistor is connected to the end of the compensation wire of the thermocouple, and the first resistor is a temperature acquisition element of the reference junction of the thermocouple; the analog-to-digital converter is also used to determine a second digital signal corresponding to the second voltage signal; the processor is also used to determine a code value based on the second digital signal, and determine a first absolute voltage of the reference junction of the thermocouple based on the code value.
[0015] In an exemplary embodiment, the cold-end compensation circuit is used to input a reference voltage signal corresponding to a reference resistor of the cold-end compensation circuit into the analog-to-digital converter; the analog-to-digital converter is further used to determine a reference digital signal corresponding to the reference voltage signal; the processor is further used to determine a reference code value corresponding to the reference digital signal; and the first absolute voltage is determined based on the reference code value, the code value and a first resistance value of the reference resistor.
[0016] In an exemplary embodiment, the thermocouple acquisition circuit includes: a thermocouple, a diagnostic circuit connected to the thermocouple, an inductor connected to the diagnostic circuit, and a filter circuit connected to the inductor, wherein the thermocouple is used to acquire the first voltage signal; the diagnostic circuit is used to determine whether the thermocouple is faulty based on the acquired first voltage signal; the inductor is used to suppress common-mode interference in the first voltage signal; and the filter circuit is used to filter high-frequency noise in the first voltage signal.
[0017] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned temperature determination method when running.
[0018] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the temperature determination method through the computer program.
[0019] Through the present application, the maximum gain of the analog-to-digital converter is determined according to the thermocouple, and the resolution is determined according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter. Since the gain of the analog-to-digital converter is large and the external reference voltage generally has the advantages of high precision and low noise, the resolution of the analog-to-digital converter can be accurately determined, thereby improving the accuracy of the analog-to-digital converter in obtaining the voltage signal input by the thermocouple, thereby improving the accuracy of the obtained pressure difference; since the accuracy of the obtained pressure difference is improved, the accuracy of the second absolute temperature is improved, and the accuracy of the temperature collected by the thermocouple can be improved; therefore, the above-mentioned scheme can solve the problem of poor temperature accuracy collected by the thermocouple. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The exemplary embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 It is a hardware structure block diagram of a computer terminal of the method for determining temperature of an embodiment of the present application;
[0022] Figure 2 is a flow chart of a method for determining temperature according to an embodiment of the present application;
[0023] Figure 3 is a circuit diagram (I) of a temperature determination circuit according to an embodiment of the present application;
[0024] Figure 4 is a corresponding relationship diagram of the resolution, gain and output data rate of the analog-to-digital converter according to an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of a PCB and a terminal block according to an embodiment of the present application;
[0026] Figure 6 2 is a circuit diagram of a temperature determination circuit according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0028] It should be noted that the terms and "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 is a hardware structure block diagram of a computer terminal of the temperature determination method of the embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a microprocessor (Microprocessor Unit, referred to as MPU) or a programmable logic device (Programmable logic device, referred to as PLD)) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the temperature in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, which is equivalent to implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0031] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] In this embodiment, a method for determining temperature is provided. Figure 2 : is a flow chart of a method for determining temperature according to an embodiment of the present application, the flow chart comprising the following steps:
[0033] Step S202: determining the resolution of the analog-to-digital converter according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, wherein the maximum gain is determined according to the thermocouple corresponding to the analog-to-digital converter.
[0034] Step S204, determining the pressure difference according to the first digital signal output by the analog-to-digital converter, and determining the code value corresponding to the first resistor according to the second digital signal output by the analog-to-digital converter, wherein the first digital signal is determined by the analog-to-digital converter according to the resolution and the first voltage signal collected by the thermocouple, and the pressure difference is the pressure difference between the measurement junction and the reference junction of the thermocouple.
[0035] Step S206, determining a first absolute voltage of a reference junction point of the thermocouple.
[0036] Step S208: determining a second absolute voltage of the measurement junction of the thermocouple according to the pressure difference and the first absolute voltage, and determining a first temperature of the measurement junction of the thermocouple according to the second absolute voltage.
[0037] Through the above steps, the maximum gain of the analog-to-digital converter is determined according to the thermocouple, and the resolution is determined according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter. Since the gain of the analog-to-digital converter is large and the external reference voltage generally has the advantages of high precision and low noise, the resolution of the analog-to-digital converter can be accurately determined, thereby improving the accuracy of the analog-to-digital converter in obtaining the voltage signal input by the thermocouple, thereby improving the accuracy of the obtained pressure difference; since the accuracy of the obtained pressure difference is improved, the accuracy of the second absolute temperature is improved, and the accuracy of the temperature collected by the thermocouple can be improved; therefore, the above scheme can solve the problem of poor temperature accuracy collected by the thermocouple.
[0038] It should be noted that the above temperature determination method can also be applied to a temperature determination circuit. The temperature determination circuit has N (for example, 4) channel acquisition circuits. The circuits of the N channels are exactly the same. Therefore, Figure 3 Only one channel is shown. Figure 3 As shown, the temperature determination circuit includes: a thermocouple acquisition circuit, a cold end compensation circuit, U1, and U2;
[0039] Thermocouple acquisition circuit, including: TC, R1, R2, R3, R4, R5, R6, L, C1, C2, C3; cold end compensation circuit, including: R7, PT1, PT2, PT3, PT4, R8;
[0040] Wherein, TC is a thermocouple sensor, which is used to collect the temperature of the measured end (equivalent to the measurement junction in the above embodiment), and converts the temperature signal into a small voltage signal and enters the ADC channel for conversion;
[0041] R1 is the pull-up resistor at the positive end of the differential circuit on the channel acquisition side, with a resistance of 10MΩ, which is pulled up to the AVDD voltage, which is the analog voltage for powering the ADC; R3 and R4 are voltage divider resistors that provide bias voltage for the differential circuit. Here, R3=R4=10MΩ is taken to ensure that the voltage divider value is AVDD / 2; R2 is a series resistor that acts as a current limiter and is 4.7k.
[0042] It should be noted that the circuit composed of R1, R2, R3, and R4 is a diagnostic circuit for TC sensor breakage; note that the values of R1, R3, and R4 must be in the megohm level to ensure a lower bias current, because the bias current will flow through the thermocouple and resistor leads, generating additional errors, which will have a relatively large impact on the acquisition accuracy.
[0043] L is the common mode inductor, which is used to suppress common mode interference and ensure the accuracy of the collected differential mode signal;
[0044] R5, R6, C1, C2, and C3 form a low-pass filter circuit at the front end of the ADC to filter out high-frequency noise. Here, the series resistance is R5=R6=4.7k, the common-mode capacitor C2=C3=10nF, and the differential-mode capacitor C1=100nF; the common-mode cutoff frequency of the above low-pass filter circuit is Fcm=1 / (2π×4700×0.01)=3388Hz; the differential-mode cutoff frequency is Fdm=1 / (2π×4700×(0.01+2×0.1))=161Hz.
[0045] From the above formula, we can see that the filter circuit can effectively filter out common-mode noise above 3.388kHz and differential-mode noise above 161Hz.
[0046] U1 is a Σ-Δ type ADC with high precision and high resolution, which collects the TC channel side voltage and the cold end compensation channel voltage. The ADC has an internal integrated PGA and digital filter, and different PGA and filters can be configured and selected according to the actual application;
[0047] U2 is an external high-precision reference source, which provides a precise reference for TC channel acquisition to ensure acquisition accuracy;
[0048] R7 is a high-precision, low-temperature drift precision resistor with an accuracy of one ten-thousandth and a temperature drift of 5ppm. It is used as a reference resistor for collecting the resistance value of PT1000.
[0049] PT1, PT2, PT3, and PT4 are four platinum resistors PT1000, which are used as temperature acquisition elements for cold-end compensation of four channels CH1-CH4, respectively, to collect the temperature of the cold end of the corresponding channel;
[0050] R8 is a common precision resistor, which plays a current limiting role in the cold end compensation link.
[0051] Optionally, there are many ways to implement the above-mentioned step S202. An embodiment of the present application provides an implementation method, which is as follows: determine the maximum voltage allowed to be collected by the thermocouple; calculate a first ratio of the external reference voltage and the maximum voltage, and use the first ratio as the maximum gain; determine the resolution based on the maximum gain and the sampling rate of the analog-to-digital converter, wherein the resolution corresponds to the maximum gain and the sampling rate.
[0052] For example, assuming that the voltage of the external reference source U2 of the analog-to-digital converter is VREF, the resolution of the analog-to-digital converter is N, the gain is G, the sampling frequency of a single channel is F, and the least significant bit that the ADC can collect is LSB; according to the definition of LSB, the smaller the value of LSB, the higher the collection accuracy of the analog-to-digital converter.
[0053] The calculation formula of LSB is: LSB = V_REF / (2^N×G);
[0054] From the calculation formula of LSB, it can be seen that the larger the resolution N of the analog-to-digital converter, the higher the gain G, and the smaller the reference voltage, the smaller the LSB.
[0055] According to the digital filter inside the analog-to-digital converter, the relationship between resolution N, gain G and output data rate is as follows: Figure 4 shown.
[0056] Since the larger the input gain G configured by the analog-to-digital converter, the higher the accuracy of signal acquisition, the maximum gain allowed can be configured for different thermocouples when configuring the analog-to-digital converter. Assuming the maximum voltage supported by the thermocouple is UT and the reference voltage of the analog-to-digital converter is VREF, the calculation formula for the maximum gain G is:
[0057] According to formula (1), the theoretical maximum gain value that can be configured for each thermocouple is determined, and then combined with the known sampling time required, the maximum gain value can be calculated by finding Figure 4 The corresponding relationship in can determine the resolution N of the analog-to-digital converter. Take K-type thermocouple as an example:
[0058] The voltage range of the K-type thermocouple is -6.458 to 52.410. Assuming the reference voltage UREF = 2.5V, according to formula (1), the theoretical maximum gain can be calculated as G = 2.5*1000mV / 52.41mV = 47.7. Figure 4 The corresponding relationship in can determine that the maximum gain is 32. If the sampling rate is 50SPS, find again Figure 4 The corresponding relationship in shows that the resolution N=18.5.
[0059] Therefore, when configuring the analog-to-digital converter, N can be configured as 19 (rounded up), the gain can be configured as 32, and the sampling rate can be configured as 50SPS. Under this configuration, the highest voltage accuracy of the K-type thermocouple can be obtained as:
[0060] According to the working principle of thermocouple, the absolute voltage E(t,0) of the measuring junction, the pressure difference E(t,t0) between the measuring junction and the reference junction, and the absolute voltage E(t0,0) of the reference junction have the following relationship: E(t,0)=E(t,t0)+E(t0,0);
[0061] Among them, E(t, t0) can be obtained through the thermocouple acquisition circuit, and E(t0, 0) can be obtained through the cold end compensation acquisition circuit, and then the two can be summed to obtain the potential E(t, 0) of the measurement junction point. Therefore, in order to achieve the purpose of high-precision acquisition, it is possible to consider the two aspects of improving the acquisition of E(t, t0) and E(t0, 0). Therefore, the embodiment of the present application proposes a method to improve the accuracy of E(t0, 0), as follows: determine the code value corresponding to the first resistor according to the second digital signal output by the analog-to-digital converter, wherein the second digital signal is determined by the analog-to-digital converter according to the second voltage signal of the first resistor of the cold end compensation circuit corresponding to the analog-to-digital converter, the first resistor is connected to the end of the compensation wire of the thermocouple, and the first resistor is the temperature acquisition element of the reference junction point of the thermocouple; determine the first absolute voltage of the reference junction point of the thermocouple according to the code value.
[0062] In an embodiment of the present application, the first resistor is connected to the end of the compensation wire of the thermocouple, and the first resistor is connected to the end of the compensation wire of the thermocouple to improve the accuracy of the first absolute voltage. Since the accuracy of the obtained pressure difference and the first absolute voltage is improved, the accuracy of the second absolute temperature is improved, and the accuracy of the temperature collected by the thermocouple can be improved.
[0063] In the embodiment of the present application, in order to solve the problem of high temperature and temperature instability caused by the cold end of the thermocouple near the thermal device, a compensation wire is usually used to pull the cold end of the thermocouple away to an environment with a relatively constant temperature and connect it to the measuring device. At this time, the actual cold end is the end position of the compensation wire. In the embodiment of the present application, the position of the cold end is actually located at the wiring terminal, such as Figure 5 As shown, place the thermal resistor PT for measuring the cold end temperature at the end of the compensation wire in the terminal, select a two-wire PT with leads, and solder the two leads into the solder holes reserved in the PCB.
[0064] Specifically, determining the first absolute voltage of the reference junction of the thermocouple according to the code value includes: determining a reference code value corresponding to a reference digital signal, wherein the reference digital signal is determined by the analog-to-digital converter according to a reference voltage signal corresponding to a reference resistor; and determining the first absolute voltage according to the reference code value, the code value and a first resistance value of the reference resistor.
[0065] Further, determining the first absolute voltage according to the reference code value, the code value and the first resistance value of the reference resistor includes: calculating a second ratio of the code value and the reference code value; calculating the product of the second ratio and the first resistance value of the reference resistor, and using the product as the second resistance value of the first resistor; and determining the first absolute voltage according to the second resistance value.
[0066] like Figure 3 As shown, R7, PT1, PT2, PT3, PT4, and R8 form a cold-end compensation circuit, and the analog-to-digital converter outputs a constant current source Iout through the cold-end compensation circuit. Among them, the voltage U2 (equivalent to the reference voltage signal in the above embodiment) generated by the precision resistor R7 (equivalent to the first resistance value of the reference resistor in the above embodiment) is used as the acquisition reference voltage of the platinum resistor PT1 (equivalent to the first resistor in the above embodiment), and the voltage U1 across the cold-end compensation resistor PT1 of channel 1 (equivalent to the first absolute voltage in the above embodiment) is collected through channels AIN9 and AIN10 of the analog-to-digital converter. Suppose the resistance value of PT1 is Rx (equivalent to the second resistance value in the above embodiment), the collected code value is Code, and the full-scale code value corresponding to the reference voltage U2 is Code FS (equivalent to the reference code value in the above embodiment), there is the following formula:
[0067]
[0068] From this we can calculate the value of Rx:
[0069] In an exemplary embodiment, determining the first absolute voltage according to the second resistance value includes: determining the second temperature of the reference junction corresponding to the second resistance value according to first table information, wherein the first table information stores the correspondence between the resistance value of the first resistor and the temperature of the reference junction; and determining the first absolute voltage corresponding to the second temperature according to second table information, wherein the second table information stores the correspondence between the temperature of the reference junction and the voltage of the reference junction.
[0070] By looking up the resistance-temperature table of PT1000, the temperature T0 of the reference junction at this time can be obtained, and then by looking up the voltage-temperature table of the thermocouple again, the absolute voltage E(t0,0) of the reference junction can be obtained.
[0071] In this embodiment, a temperature determination circuit is also provided, which is used to implement the above embodiments and preferred implementations, and the descriptions that have been made are not repeated. Although the devices described in the following embodiments are preferably implemented in software, the implementation in hardware, or a combination of software and hardware, is also possible and conceivable.
[0072] Figure 6 is a structural block diagram of a temperature determination circuit according to an embodiment of the present application, the circuit comprising:
[0073] A thermocouple acquisition circuit 62 , an analog-to-digital converter 64 connected to the thermocouple acquisition circuit 62 , and a processor 66 connected to the analog-to-digital converter 64 .
[0074] The processor 66 is used to determine the resolution of the analog-to-digital converter 64 according to the maximum gain of the analog-to-digital converter 64 and the external reference voltage of the analog-to-digital converter 64, wherein the maximum gain is determined according to the thermocouple in the thermocouple acquisition circuit 62;
[0075] The thermocouple acquisition circuit 62 is used to input the first voltage signal acquired by the thermocouple into the analog-to-digital converter 64;
[0076] The analog-to-digital converter 64 is used to determine a first digital signal corresponding to the voltage signal according to the resolution;
[0077] The processor 66 is further used to determine a pressure difference based on the first digital signal; determine a first absolute voltage of a reference junction of the thermocouple; determine a second absolute voltage of a measurement junction of the thermocouple based on the pressure difference and the first absolute voltage, and determine a first temperature of the measurement junction of the thermocouple based on the second absolute voltage, wherein the pressure difference is the pressure difference between the measurement junction and the reference junction of the thermocouple.
[0078] Through the above-mentioned device, the maximum gain of the analog-to-digital converter is determined according to the thermocouple, and the resolution is determined according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter. Since the gain of the analog-to-digital converter is large and the external reference voltage generally has the advantages of high precision and low noise, the resolution of the analog-to-digital converter can be accurately determined, thereby improving the accuracy of the analog-to-digital converter in obtaining the voltage signal input by the thermocouple, thereby improving the accuracy of the obtained pressure difference; since the accuracy of the obtained pressure difference is improved, the accuracy of the second absolute temperature is improved, and the accuracy of the temperature collected by the thermocouple can be improved; therefore, the above-mentioned scheme can solve the problem of poor temperature accuracy collected by the thermocouple.
[0079] In an exemplary embodiment, the processor 66 is further used to determine the maximum voltage allowed to be collected by the thermocouple; calculate a first ratio of the external reference voltage and the maximum voltage, and use the first ratio as the maximum gain; determine the resolution based on the maximum gain and the sampling rate of the analog-to-digital converter 64, wherein the resolution corresponds to the maximum gain and the sampling rate.
[0080] In an exemplary embodiment, it also includes: a cold-end compensation circuit connected to the analog-to-digital converter 64, wherein the cold-end compensation circuit is used to input a second voltage signal corresponding to the first resistor into the analog-to-digital converter 64, wherein the first resistor is connected to the end of the compensation wire of the thermocouple, and the first resistor is a temperature acquisition element of the reference junction of the thermocouple; the analog-to-digital converter 64 is also used to determine a second digital signal corresponding to the second voltage signal; the processor 66 is also used to determine a code value according to the second digital signal, and determine a first absolute voltage of the reference junction of the thermocouple according to the code value.
[0081] In an exemplary embodiment, the cold-end compensation circuit is used to input a reference voltage signal corresponding to a reference resistor of the cold-end compensation circuit to the analog-to-digital converter 64; the analog-to-digital converter 64 is also used to determine a reference digital signal corresponding to the reference voltage signal; the processor 66 is also used to determine a reference code value corresponding to the reference digital signal; and the first absolute voltage is determined according to the reference code value, the code value and a first resistance value of the reference resistor.
[0082] In an exemplary embodiment, the thermocouple acquisition circuit 62 includes: a thermocouple, a diagnostic circuit connected to the thermocouple, an inductor connected to the diagnostic circuit, and a filter circuit connected to the inductor, wherein the thermocouple is used to acquire the first voltage signal; the diagnostic circuit is used to determine whether the thermocouple is faulty based on the acquired first voltage signal; the inductor is used to suppress common-mode interference in the first voltage signal; and the filter circuit is used to filter high-frequency noise in the first voltage signal.
[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0084] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0085] S1, determining the resolution of the analog-to-digital converter according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, wherein the maximum gain is determined according to the thermocouple corresponding to the analog-to-digital converter;
[0086] S2, determining the pressure difference according to the first digital signal output by the analog-to-digital converter, and determining the code value corresponding to the first resistor according to the second digital signal output by the analog-to-digital converter, wherein the first digital signal is determined by the analog-to-digital converter according to the resolution and the first voltage signal collected by the thermocouple, and the pressure difference is the pressure difference between the measurement junction and the reference junction of the thermocouple;
[0087] S3, determining a first absolute voltage of a reference junction point of the thermocouple;
[0088] S4, determining a second absolute voltage of the measurement junction of the thermocouple according to the pressure difference and the first absolute voltage, and determining a first temperature of the measurement junction of the thermocouple according to the second absolute voltage.
[0089] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0090] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0091] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0092] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0093] S1, determining the resolution of the analog-to-digital converter according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, wherein the maximum gain is determined according to the thermocouple corresponding to the analog-to-digital converter;
[0094] S2, determining the pressure difference according to the first digital signal output by the analog-to-digital converter, and determining the code value corresponding to the first resistor according to the second digital signal output by the analog-to-digital converter, wherein the first digital signal is determined by the analog-to-digital converter according to the resolution and the first voltage signal collected by the thermocouple, and the pressure difference is the pressure difference between the measurement junction and the reference junction of the thermocouple;
[0095] S3, determining a first absolute voltage of a reference junction point of the thermocouple;
[0096] S4, determining a second absolute voltage of the measurement junction of the thermocouple according to the pressure difference and the first absolute voltage, and determining a first temperature of the measurement junction of the thermocouple according to the second absolute voltage.
[0097] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0098] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0099] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0100] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining temperature, characterized in that: include: Determining the resolution of the analog-to-digital converter according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, wherein the maximum gain is determined according to the thermocouple corresponding to the analog-to-digital converter; Determine the pressure difference according to the first digital signal output by the analog-to-digital converter, and determine the code value corresponding to the first resistor according to the second digital signal output by the analog-to-digital converter, wherein the first digital signal is determined by the analog-to-digital converter according to the resolution and the first voltage signal collected by the thermocouple, and the pressure difference is the pressure difference between the measurement junction point and the reference junction point of the thermocouple; determining a first absolute voltage at a reference junction of the thermocouple; A second absolute voltage at a measurement junction of the thermocouple is determined based on the pressure difference and the first absolute voltage, and a first temperature at the measurement junction of the thermocouple is determined based on the second absolute voltage.
2. The method for determining temperature according to claim 1, characterized in that: Determining the resolution of the analog-to-digital converter according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, comprising: Determining a maximum voltage allowed to be collected by the thermocouple; Calculating a first ratio of the external reference voltage to the maximum voltage, and using the first ratio as the maximum gain; The resolution is determined according to the maximum gain and a sampling rate of the analog-to-digital converter, wherein the resolution corresponds to the maximum gain and the sampling rate.
3. The method for determining temperature according to claim 1, characterized in that: Determining a first absolute voltage at a reference junction of the thermocouple comprises: Determine a code value corresponding to a first resistor according to a second digital signal output by the analog-to-digital converter, wherein the second digital signal is determined by the analog-to-digital converter according to a second voltage signal of a first resistor of a cold-end compensation circuit corresponding to the analog-to-digital converter, the first resistor is connected to an end of a compensation wire of the thermocouple, and the first resistor is a temperature acquisition element of a reference junction point of the thermocouple; A first absolute voltage of a reference junction of the thermocouple is determined based on the code value.
4. The method for determining temperature according to claim 3, characterized in that: Determining a first absolute voltage of a reference junction point of the thermocouple according to the code value includes: Determine a reference code value corresponding to a reference digital signal, wherein the reference digital signal is determined by the analog-to-digital converter according to a reference voltage signal corresponding to a reference resistor; The first absolute voltage is determined according to the reference code value, the code value, and a first resistance value of the reference resistor.
5. The method for determining temperature according to claim 4, characterized in that: Determining the first absolute voltage according to the reference code value, the code value, and a first resistance value of the reference resistor includes: calculating a second ratio of the code value to a reference code value; Calculating a product of the second ratio and a first resistance value of the reference resistor, and using the product as a second resistance value of the first resistor; The first absolute voltage is determined according to the second resistance value.
6. The method for determining temperature according to claim 5, characterized in that: Determining the first absolute voltage according to the second resistance value includes: Determine a second temperature of the reference junction point corresponding to the second resistance value according to first table information, wherein the first table information stores a correspondence between the resistance value of the first resistor and the temperature of the reference junction point; The first absolute voltage corresponding to the second temperature is determined according to second table information, wherein the second table information stores a correspondence between the temperature of the reference junction point and the voltage of the reference junction point.
7. A temperature determination circuit, characterized in that: include: A thermocouple acquisition circuit, an analog-to-digital converter connected to the thermocouple acquisition circuit, and a processor connected to the analog-to-digital converter, wherein: The processor is used to determine the resolution of the analog-to-digital converter according to the maximum gain of the analog-to-digital converter and the external reference voltage of the analog-to-digital converter, wherein the maximum gain is determined according to the thermocouple in the thermocouple acquisition circuit; The thermocouple acquisition circuit is used to input the first voltage signal acquired by the thermocouple into the analog-to-digital converter; The analog-to-digital converter is used to determine a first digital signal corresponding to the voltage signal according to the resolution; The processor is further used to determine a pressure difference based on the first digital signal; determine a first absolute voltage of a reference junction of the thermocouple; determine a second absolute voltage of a measurement junction of the thermocouple based on the pressure difference and the first absolute voltage, and determine a first temperature of the measurement junction of the thermocouple based on the second absolute voltage, wherein the pressure difference is the pressure difference between the measurement junction and the reference junction of the thermocouple.
8. The temperature determination circuit according to claim 7, characterized in that: include: The processor is also used to determine the maximum voltage allowed to be collected by the thermocouple; calculate a first ratio of the external reference voltage and the maximum voltage, and use the first ratio as the maximum gain; determine the resolution based on the maximum gain and the sampling rate of the analog-to-digital converter, wherein the resolution corresponds to the maximum gain and the sampling rate.
9. The temperature determination circuit according to claim 7, characterized in that: Also includes: A cold junction compensation circuit connected to the analog-to-digital converter, wherein: The cold junction compensation circuit is used to input the second voltage signal corresponding to the first resistor into the analog-to-digital converter, wherein the first resistor is connected to the end of the compensation wire of the thermocouple, and the first resistor is a temperature acquisition element of the reference junction point of the thermocouple; The analog-to-digital converter is further used to determine a second digital signal corresponding to the second voltage signal; The processor is further configured to determine a code value according to the second digital signal, and determine a first absolute voltage of a reference junction point of the thermocouple according to the code value.
10. The temperature determination circuit according to claim 9, characterized in that: include: The cold junction compensation circuit is used to input a reference voltage signal corresponding to a reference resistor of the cold junction compensation circuit into the analog-to-digital converter; The analog-to-digital converter is further used to determine a reference digital signal corresponding to the reference voltage signal; The processor is further configured to determine a reference code value corresponding to the reference digital signal; and determine the first absolute voltage according to the reference code value, the code value, and a first resistance value of the reference resistor.
11. The temperature determination circuit according to claim 7, characterized in that: The thermocouple acquisition circuit comprises: A thermocouple, a diagnostic circuit connected to the thermocouple, an inductor connected to the diagnostic circuit, and a filter circuit connected to the inductor, wherein: The thermocouple is used to collect the first voltage signal; The diagnostic circuit is used to determine whether the thermocouple is faulty according to the collected first voltage signal; The inductor is used to suppress common mode interference in the first voltage signal; The filtering circuit is used to filter high-frequency noise in the first voltage signal.
12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
