A multi-channel temperature measurement and correction method, system, storage medium and electronic device
By implementing a multi-channel temperature measurement correction method on a microcomputer with a single ADC channel, calculating and applying the correction coefficient, the problem of high cost of multi-channel temperature measurement correction is solved, and high-precision and low-power temperature measurement correction is achieved.
Patent Information
- Application Number
- CN202210778709.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2042-07-04
AI Technical Summary
Among the existing multi-channel temperature measurement correction methods, the price of multi-channel ADC microcomputers or external ADC chips is high, resulting in excessive production costs.
By implementing a multi-channel temperature measurement correction method on a microcomputer with a single ADC channel, multiple temperature information are collected, the correction coefficients of each temperature channel are calculated, and subsequent temperature information is corrected using these correction coefficients to realize multi-channel temperature measurement correction.
This method uses only one ADC channel, reducing production costs, while improving the accuracy and efficiency of temperature measurement by controlling the temperature power supply and using correction formulas.
Smart Images

Figure CN115112266B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of temperature measurement and calibration, and in particular, to a multi-channel temperature measurement and calibration method, system, storage medium, and electronic device. Background Art
[0002] Temperature is a very important and common parameter in the industrial and agricultural production process. The measurement and calibration of temperature play a very important role. For example, accurate temperature measurement is required to ensure product quality, improve production efficiency, save energy, and ensure production safety. Therefore, there is a wide demand for multi-channel, low-cost, and high-precision temperature measurement devices.
[0003] In the temperature measurement and calibration methods currently adopted in the industry, when measuring the temperatures of multiple channels, generally a microcomputer with a multi-channel analog-to-digital converter (Digital to analog converter) function or a microcomputer with an external ADC chip to expand the temperature measurement and calibration channels is used for temperature measurement. However, the price of a microcomputer with a multi-channel ADC or a microcomputer with an external ADC chip is relatively expensive, resulting in the problem of too high production costs. Summary of the Invention
[0004] In order to improve the problem of high production costs in the multi-channel temperature measurement and calibration process, this application provides a multi-channel temperature measurement and calibration method, system, storage medium, and electronic device.
[0005] In a first aspect, an embodiment of this application provides a multi-channel temperature measurement and calibration method, which adopts the following technical solutions:
[0006] The multi-channel temperature measurement and calibration method is applicable to a microcomputer with a single ADC channel. The method includes:
[0007] Collect a plurality of first temperature information at a first time;
[0008] Open a temperature channel, and calculate the calibration coefficient of the temperature channel according to a first temperature information;
[0009] Close the current temperature channel and switch to the next temperature channel until the calibration coefficients of all temperature channels are calculated, where one of the calibration coefficients corresponds to one of the first temperature information;
[0010] Collect a plurality of second temperature information at a second time;
[0011] Use the calibration coefficient to correct each of the second temperature information one by one to obtain the final temperature of each temperature channel.
[0012] Through the above technical solution, multiple first temperature information is obtained, and then the temperature channels are opened one by one. Through the temperature channels, the first temperature information is input into the ADC channels of the microcomputer one by one, and the microcomputer calculates the correction coefficients of the first temperature information one by one. The second temperature information is collected and input into the microcomputer one by one. The microcomputer corrects the second temperature information by using the correction coefficients. This solution realizes the temperature measurement and correction of multiple temperatures by only using one ADC channel, thereby reducing the production cost.
[0013] Preferably, before collecting multiple first temperature information at the first time, it further includes:
[0014] Output a first control signal, and the first control signal is used to turn on the temperature power supply.
[0015] Preferably, after outputting the first control signal, which is used to turn on the temperature power supply, it further includes: outputting a second control signal, and the second control signal is used to turn off the temperature power supply.
[0016] Through the above technical solution, the temperature power supply is turned on and off to control the working duration of the temperature measuring device, reduce the heat generation of the temperature measuring device, reduce the influence of the heat generation on the temperature measurement, and further improve the accuracy of the temperature measurement. At the same time, the temperature power supply is reasonably used, the aging of the temperature power supply is slowed down, the service life of the temperature power supply is extended, and the entire temperature measurement and correction process is in a low-power state.
[0017] Preferably, when opening a temperature channel, the opening of a temperature channel and calculating the correction coefficient of the temperature channel according to a first temperature information includes:
[0018] Convert the first temperature information into first AD information through an ADC converter;
[0019] Use the first correction formula to calculate the correction coefficient of the temperature channel, where the first correction formula is:
[0020]
[0021] Among them, AD1 is the first AD information, N is the maximum range of the ADC converter, R1 is the resistance value of the correction resistor, R2 is the standard voltage division resistance value, U2 is the standard voltage of the temperature power supply, U1 is the AD reference voltage, and K is the correction coefficient.
[0022] Through the above technical solution, the error of the temperature power supply and the error of the electronic component parameters are converted into a correction coefficient, which improves the error caused by the superposition of the temperature power supply and the electronic component parameters, and further improves the accuracy of temperature measurement. At the same time, by using the time-division multiplexing technical means, multiple first temperature information are intertwined and transmitted along the same channel in different time periods, and the time for measuring and calculating the correction coefficient once is in the order of dozens of microseconds, which improves the efficiency of temperature measurement correction.
[0023] Preferably, using the correction coefficient to correct the second temperature information one by one to obtain the final temperature of each temperature channel includes:
[0024] Converting the second temperature information into second AD information through an ADC converter;
[0025] Calculating the internal resistance of the temperature measuring device by using a second correction formula, where the second correction formula is:
[0026]
[0027] In the formula, AD2 is the second AD information, N is the maximum range of the ADC converter, Rx is the internal resistance of the temperature measuring device, R2 is the standard voltage dividing resistance, U2 is the standard voltage of the temperature power supply, U1 is the AD reference voltage, and K is the correction coefficient;
[0028] Obtaining the final temperature by looking up a table or interpolation according to the internal resistance of the temperature measuring device.
[0029] Through the above technical solution, the chip data manual of the temperature measuring device is pre-stored in the microcomputer in advance. After calculating the internal resistance of the temperature measuring device, the final measured temperature can be directly obtained by looking up a table or interpolation, reducing the amount of calculation and improving the overall correction detection efficiency.
[0030] Preferably, after using the correction coefficient to correct the second temperature information one by one to obtain the final temperature of each temperature channel, it further includes:
[0031] Storing the final temperature in the memory built in the microcomputer.
[0032] Through the above technical solution, the finally measured temperature is stored in the microcomputer, which is convenient for calling the finally measured temperature data.
[0033] In a second aspect, an embodiment of the present application provides a multi-channel temperature measurement correction system, adopting the following technical solution:
[0034] A temperature acquisition module for acquiring multiple first temperature information at a first time;
[0035] A coefficient calculation module, configured to activate a temperature channel and calculate a correction coefficient for the current temperature channel according to a temperature information.
[0036] A channel switching module, configured to close the current temperature channel and switch to the next temperature channel until the correction coefficients of all temperature channels are calculated, wherein one of the correction coefficients corresponds to one of the first temperature information.
[0037] The temperature acquisition module is further configured to acquire a plurality of second temperature information at a second time.
[0038] The coefficient calculation module is further configured to use the correction coefficient to correct each of the second temperature information one by one to obtain the final temperature of each temperature channel.
[0039] Through the above technical solution, the correction coefficients corresponding to a plurality of first temperature information are obtained from the first temperature information at the first time calculated through a temperature channel, and then the obtained plurality of second temperature information at the second time is continuously passed through a temperature channel, and the corrected temperature is obtained by using the correction coefficient. Only one temperature channel is used to realize multi-channel temperature measurement correction, thereby improving the problem of high production cost of multi-channel temperature measurement correction.
[0040] Preferably, the multi-channel temperature measurement correction system further includes:
[0041] An IO port expansion module, configured to expand the data channel.
[0042] Through the above technical solution, the data channel of the microcomputer is expanded, more temperature information can be acquired, and at the same time, a data port is reserved, and other functional modules can be added at any time.
[0043] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded and executed by a processor to perform the above method steps.
[0044] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein, the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor to perform the above method steps.
[0045] In summary, the present application includes at least one of the following beneficial technical effects:
[0046] 1. The correction coefficients corresponding to a plurality of first temperature information are obtained from the first temperature information at the first time calculated through a temperature channel, and then the obtained plurality of second temperature information at the second time is continuously passed through a temperature channel, and the corrected temperature is obtained by using the correction coefficient. Only one temperature channel is used to realize multi-channel temperature measurement correction, thereby improving the problem of high production cost of multi-channel temperature measurement correction.
[0047] 2. By pre-storing the chip data sheet of the temperature measurement device in the microcomputer in advance, after calculating the internal resistance of the temperature measurement device, the finally measured temperature can be directly obtained by looking up a table or interpolation, reducing the amount of calculation and improving the operation speed of the entire temperature measurement and correction.
[0048] 3. By timely controlling the temperature power supply, reducing the heat generation of electronic components, further increasing the accuracy of temperature measurement and correction. At the same time, by reasonably using the temperature power supply, slowing down the aging of the temperature power supply and extending the service life of the temperature power supply, the entire temperature measurement and correction process is in a low-power state. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a flowchart of the temperature measurement and correction method in an embodiment of the present application.
[0050] Figure 2 is a flowchart of the whole process in an embodiment of the present application.
[0051] Figure 3 is a structural block diagram of the temperature measurement and correction system in an embodiment of the present application.
[0052] Figure 4 is a structural block diagram of the temperature measurement and correction system in an embodiment of the present application.
[0053] Figure 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] The following further describes the present application in detail Figures 1-5 with reference to the accompanying drawings.
[0055] An embodiment of the present application discloses a multi-channel temperature measurement and correction method, which is based on a multi-channel temperature measurement and correction system. The multi-channel temperature measurement and correction system first collects a plurality of first temperature information at a first time; opens a temperature channel, calculates a correction coefficient of the temperature channel according to a temperature information; closes the current temperature channel and switches to the next temperature channel until the correction coefficients of all temperature channels are calculated, wherein one of the correction coefficients corresponds to one of the first temperature information; collects a plurality of second temperature information at a second time; and corrects the second temperature information one by one by using the correction coefficient to obtain the final temperature of each temperature channel.
[0056] An embodiment of the present application discloses a multi-channel temperature measurement and correction method, referring to Figure 1 the following, the method includes the following steps:
[0057] S10. Collect a plurality of first temperature information at a first time.
[0058] Specifically, the time for temperature measurement before the first-time calibration, the first temperature information is the temperature information measured by each device at the first time, and the first temperature information can be detected by a temperature sensor. For example, through multiple temperature sensors with internal resistance, the internal resistance value of which is proportional to the change in temperature, and using its characteristic of increasing with the rising temperature to measure the temperature.
[0059] For example, a PT1000 temperature sensor can be used, which contains a platinum resistance of 1000 ohms. When the temperature of the PT1000 is 0 degrees Celsius, its resistance value is 1000 ohms, and at 100 degrees Celsius, its resistance value is approximately 1385.005 ohms.
[0060] S20, turn on a temperature channel, and calculate the calibration coefficient of the temperature channel according to a first temperature information.
[0061] Specifically, the temperature channel refers to a channel through which only one signal passes when there are multiple first temperature information. The first temperature information detected by the sensor is analog temperature information. Before calculating the calibration coefficient, the analog temperature information needs to be converted into digital temperature information first. Among them, the first temperature information is transmitted to the AD converter in the microcomputer through the temperature channel, and the AD converter converts the corresponding analog temperature information into digital temperature information, and calculates the calibration coefficient of the first temperature information according to the digital temperature information.
[0062] S30, close the current temperature channel and switch to the next temperature channel until the calibration coefficients of all temperature channels are calculated, where one calibration coefficient corresponds to one first temperature information.
[0063] Specifically, the temperature channel is switched through a channel switching module, and the channel switching module can adopt a controllable switch or a data selector. The first temperature information is transmitted to the AD converter in the microcomputer, and the AD converter converts the analog temperature information into digital temperature information. The microcomputer calculates each digital temperature information one by one to calculate the calibration coefficient corresponding to each digital temperature information until all temperature information is processed.
[0064] For example, the channel switching module adopts a data selector, and multiple temperature information is transmitted to the data selector. The data selector only passes one first temperature information, and this first temperature information reaches the AD converter embedded in the microcomputer. After conversion, the analog quantity of the temperature information is converted into a computable digital quantity for calculating the calibration coefficient. The data selector can adopt a 74hc4051 chip, which is an eight-to-one analog switch circuit. When 8 channels of temperature signals pass through, a control signal can be sent by the microcomputer to select one of the signals and transmit it to the microcomputer for processing. Moreover, the 74hc4051 chip can also be extended by cascading to achieve the simultaneous processing of multiple channels of temperature signals.
[0065] For example, the channel switching module can select the SGM3005 chip. The SGM3005 chip includes two normally open and two normally closed controllable switches, which can switch and transmit the temperature information at different times to the computer according to the control signal sent by the microcomputer. Among them, the controllable switch can adopt an electronic analog switch, such as a MOS transistor. The internal resistance of the MOS transistor is relatively low, which can reduce the error caused by temperature change during the transmission process.
[0066] S40. Collect multiple second temperature information at the second time.
[0067] Specifically, the second time is the time for temperature measurement after obtaining the correction coefficient, and the second temperature information is the temperature information measured at the second time.
[0068] S50. Use the correction coefficient to correct each of the second temperature information one by one to obtain the final temperature of each temperature channel.
[0069] Specifically, the correction coefficient is stored in the microcomputer, and different correction coefficients are stored in different positions. The microcomputer corrects the second temperature information according to the corresponding correction coefficient, which can improve the accuracy of temperature detection.
[0070] Optionally, referring to Figure 2 , before S10, it further includes:
[0071] S9. Output a first control signal, and the first control signal is used to turn on the temperature power supply.
[0072] Optionally, after S9, it further includes:
[0073] S41. Output a second control signal, and the second control signal is used to turn off the temperature power supply.
[0074] For example, the on-off of the circuit of the temperature power supply is controlled by a switch control module. When the microprocessor needs to collect the first temperature, it sends a first control signal to act on the switch control module. One end of the switch control module is connected to the power supply, and the other end is connected to the temperature sensor. When the control signal acts on the switch control module, the circuit is turned on, and the power supply starts to supply power to the temperature sensor. At this time, the temperature sensor gets power to obtain temperature information.
[0075] When the acquisition of the first temperature signal is completed, and the microprocessor has also calculated the correction coefficient corresponding to the first temperature signal, at this time, the microprocessor sends a second control signal to act on the switch controller, and the switch controller disconnects the connection between the power supply and the temperature sensor, and the temperature sensor stops working.
[0076] For example, when the switch control module selects FDM304P and the coefficient calculation module outputs a low level to act on FDM304P, the circuit is turned on. When the measurement and calibration are completed, the coefficient calculation module outputs a high level to act on FDM304P, and the circuit is turned off.
[0077] In one embodiment, S20 includes the following sub-steps:
[0078] S21, convert the first temperature information into first AD information through an ADC converter.
[0079] S22, use the calibration formula: Calculate the calibration coefficient.
[0080] Specifically, in the calibration formula, AD1 is the first AD information, which is the digital information obtained by converting the first temperature signal by AD. It is to convert the first temperature information into the first AD information through the AD converter embedded in the microcomputer. N is the maximum range of the ADC converter. In different microcomputers, the AD conversion bits of the embedded AD converter are different. The maximum range of the N-bit AD converter is 2 N , generally speaking, the higher the number of bits of the AD converter, the higher the temperature measurement accuracy. Generally, the AD converter with more than 10 bits can measure the temperature more accurately. R1 is the resistance value of the calibration resistor, R2 is the standard voltage division resistance value, U2 is the standard voltage of the temperature power supply, U1 is the AD reference voltage, and K is the calibration coefficient.
[0081] During the temperature measurement process, there are certain errors in the power supply and resistor element parameters compared with the actual values. When performing measurement and calibration, the two errors will be superimposed to form a larger error. This calibration formula converts the errors of the temperature power supply and the electronic component parameters into a calibration coefficient, avoiding the larger error caused by the superposition of the temperature power supply and the electronic component parameters.
[0082] For example, the power supply voltage of the microcomputer is 5 volts, but it may actually be only 4.95 volts. The resistance of the resistor element is 5.6k. In fact, due to the deviation during processing and manufacturing, the final resistance value may be only 5.595k, which affects the accuracy of temperature measurement. The calibration coefficient is to convert the errors of the power supply and the electronic components into a coefficient. Ideally, this calibration coefficient should be equal to 1, but in fact, due to various reasons, the existing errors will make the calibration coefficient close to 1, but not equal to 1.
[0083] In one embodiment, S50 includes the following sub-steps:
[0084] S51, convert the second temperature information into second AD information through an ADC converter.
[0085] S52, use the calibration formula: Calculate the internal resistance of the temperature measurement device.
[0086] S53. Obtain the final temperature in a way of looking up a table or interpolation according to the internal resistance of the temperature measurement device.
[0087] Specifically, in the calibration formula, AD2 is the second AD information, which is the information obtained by the AD converter converting the second temperature information. N is the maximum range of the ADC converter, Rx is the internal resistance of the temperature measurement device, R2 is the standard voltage division resistance, U2 is the standard voltage of the temperature power supply, U1 is the AD reference voltage, and K is the calibration coefficient.
[0088] The resistance value of the internal resistance of the temperature measurement device calculated through the calibration formula can be quickly corresponded to the temperature corresponding to the internal resistance value of the temperature measurement device in the current situation by looking up a table and interpolation with the data manual of the temperature measurement device preset in the microcomputer in advance. The temperature at this time is the final temperature.
[0089] Optionally, after S50, it further includes:
[0090] S60. Store the final temperature into the memory built in the microcomputer.
[0091] Specifically, save the finally calibrated measured temperature into the memory built in the microcomputer for the convenience of calling the finally measured temperature.
[0092] The embodiment of the present application also discloses a multi-channel temperature measurement and calibration system. Refer to Figure 3 , this system includes the following modules: a temperature acquisition module, which is used to acquire a plurality of first temperature information at the first time; and is also used to acquire a plurality of second temperature information at the second time.
[0093] A coefficient calculation module, which is used to open a temperature channel and calculate the calibration coefficient of the current temperature channel according to a temperature information; and is also used to use the calibration coefficient to correct each of the second temperature information one by one to obtain the final temperature of each temperature channel.
[0094] A channel switching module, which is used to close the current temperature channel and switch to the next temperature channel until the calibration coefficients of all temperature channels are calculated, wherein one calibration coefficient corresponds to one of the first temperature information.
[0095] In an embodiment, refer to Figure 4 , this system further includes the following modules:
[0096] A switch control module, which is used to acquire a switch control signal to turn on or off the temperature power supply of the temperature acquisition module.
[0097] An IO port expansion module, which is used to expand the data channel.
[0098] Specifically, the temperature acquisition module may include several temperature sensor units. The channel switching module may employ a data selector, and the switch control module may use several electronic analog switches. For example, the electronic analog switch is a pmos switch tube, and the IO port expansion module includes several shift register chips.
[0099] When temperature information needs to be measured, the microcomputer sends a control signal to the electronic analog switch. One end of the electronic analog switch is connected to the power supply, and the other end is connected to the temperature sensor. The electronic analog switch is controlled to turn on, and the temperature sensor is powered on to work and starts to acquire temperature information, obtaining several first-time temperature information. At the same time, the microcomputer sends a control signal to the data selector, and the control signal controls to open a temperature channel, transmitting a first temperature information to the AD converter. The AD converter converts the analog temperature signal into a digital temperature signal, and then transmits the digital temperature signal to the microcomputer. A correction coefficient is calculated through a preset first correction formula. The current temperature channel is closed and other temperature channels are opened one by one, and the correction coefficients of all the first-time temperature information are calculated, and several correction coefficients are stored in the memory in the microcomputer.
[0100] The circuit of the temperature sensor is turned off through the switch control module, and the temperature sensor does not work and can be cooled. After a preset time, the microcomputer sends a control signal to the switch control module to make the temperature sensor work again. At this time, the temperature sensor starts to acquire the second temperature information. At the same time, the microcomputer opens the temperature channels one by one through the data selector, transmits and calculates the corrected internal resistance value of the temperature sensor through the second correction formula and the correction coefficient, and then queries the temperature corresponding to the resistance value through methods such as table lookup and interpolation to obtain the final temperature, and finally stores the final temperature in the memory in the microcomputer.
[0101] The embodiment of the present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above Figures 1-4 The multi-channel temperature measurement and correction method of the embodiment shown, and the specific execution process can be referred to Figures 1-4 The specific description of the embodiment shown, and details are not described herein.
[0102] Referring to Figure 5 , a schematic structural diagram of an electronic device is provided for the embodiment of the present application. As Figure 5 shown, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.
[0103] Among them, the communication bus 1002 is used to realize the connection and communication between these components.
[0104] Among them, the user interface 1003 may include a display screen and a camera. Optionally, the user interface 1003 may also include standard wired interfaces and wireless interfaces.
[0105] Among them, the network interface 1004 may optionally include standard wired interfaces and wireless interfaces (such as WI-FI interfaces).
[0106] Among them, the processor 1001 may include one or more processing cores. The processor 1001 connects various parts within the entire server 1000 through various interfaces and circuits. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and by calling data stored in the memory 1005, the processor 1001 performs various functions of the server 1000 and processes data. Optionally, the processor 1001 may be implemented in at least one of the following hardware forms: digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1001 may integrate one or a combination of several of the following: central processing unit (CPU), graphics processing unit (GPU), and modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001 and may be implemented separately through a single chip.
[0107] Among them, the memory 1005 may include a Random Access Memory (RAM), or may also include a Read-Only Memory. Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area. Among them, the program storage area can store instructions for implementing the operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area can store the data involved in the above-mentioned method embodiments. Optionally, the memory 1005 may also be at least one storage device located far from the aforementioned processor 1001. As Figure 5 shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a multi-channel temperature measurement correction application program.
[0108] In Figure 5 the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user to obtain the data input by the user; and the processor 1001 can be used to call the multi-channel temperature measurement correction application program stored in the memory 1005 and specifically perform the following operations:
[0109] Collect a plurality of first temperature information at a first time;
[0110] Turn on a temperature channel and calculate a correction coefficient for the temperature channel according to a first temperature information;
[0111] Close the current temperature channel and switch to the next temperature channel until the correction coefficients of all temperature channels are calculated, where one of the correction coefficients corresponds to one of the first temperature information;
[0112] Collect a plurality of second temperature information at a second time;
[0113] Use the correction coefficient to correct each of the second temperature information one by one to obtain the final temperature of each temperature channel.
[0114] In one embodiment, before the processor 1001 executes the operation of collecting a plurality of first temperature information at a first time, the following operations are also performed:
[0115] Output a first control signal, and the first control signal is used to turn on the temperature power supply.
[0116] In one embodiment, after the processor 1001 executes the output of the first control signal for turning on the temperature power supply, the following operations are further performed:
[0117] Output a second control signal for turning off the temperature power supply.
[0118] In one embodiment, when the processor 1001 executes the operation of opening a temperature channel to calculate a correction coefficient of the first temperature information, the following operations are specifically performed:
[0119] Convert the first temperature information into first AD information through an ADC converter;
[0120] Calculate the correction coefficient of the temperature channel by using a first correction formula, where the first correction formula is:
[0121]
[0122] where AD1 is the first AD information, N is the maximum range of the ADC converter, R1 is the resistance value of the correction resistor, R2 is the standard voltage division resistance value, U2 is the standard voltage of the temperature power supply, U1 is the AD reference voltage, and K is the correction coefficient.
[0123] In one embodiment, when the processor 1001 executes the operation of correcting the second temperature information one by one by using the correction coefficient to obtain the final temperature, the following operations are further performed:
[0124] Convert the second temperature information into second AD information through an ADC converter;
[0125] Calculate the internal resistance of the temperature measuring device by using a second correction formula, where the second correction formula is:
[0126]
[0127] In the formula, AD2 is the second AD information, N is the maximum range of the ADC converter, Rx is the internal resistance of the temperature measuring device, R2 is the standard voltage division resistance value, U2 is the standard voltage of the temperature power supply, U1 is the AD reference voltage, and K is the correction coefficient;
[0128] Obtain the final temperature in a manner of looking up a table or interpolation according to the internal resistance of the temperature measuring device.
[0129] In one embodiment, after the processor 1001 executes the operation of correcting the second temperature information one by one by using the correction coefficient to obtain the final temperature, the following operations are specifically performed:
[0130] Store the final temperature of each temperature channel in the memory built in the microcomputer.
[0131] The above are only exemplary embodiments of the present disclosure, and the scope of the present disclosure cannot be limited thereby. That is, any equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure. Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not described in the present disclosure.
Claims
1. A multi-channel temperature measurement and calibration method, characterized in that, it is applicable to a microcomputer with a single ADC channel, and the method includes: Collecting multiple first temperature information at a first time; Enabling a temperature channel and calculating a calibration coefficient of the temperature channel according to a first temperature information, where the temperature channel refers to a channel that only passes one signal when there are multiple first temperature information; Closing the current temperature channel and switching to the next temperature channel until the calibration coefficients of all temperature channels are calculated, where one calibration coefficient corresponds to one first temperature information; Collecting multiple second temperature information at a second time; Using the calibration coefficient to correct each of the second temperature information one by one to obtain the final temperature of each temperature channel; The enabling a temperature channel and calculating a calibration coefficient of the temperature channel according to a first temperature information includes: Converting the first temperature information into a first AD information through an ADC converter; Calculating the calibration coefficient of the temperature channel by using a first calibration formula, where the first calibration formula is: where AD1 is the first AD information, N is the maximum range of the ADC converter, R1 is the resistance value of the calibration resistor, R2 is the standard voltage division resistance value, U2 is the standard temperature power supply voltage, U1 is the AD reference voltage, and K is the calibration coefficient.
2. The multi-channel temperature measurement and calibration method according to claim 1, characterized in that, before collecting multiple first temperature information at the first time, it further includes: Outputting a first control signal, where the first control signal is used to turn on the temperature power supply.
3. The multi-channel temperature measurement and calibration method according to claim 2, characterized in that, after outputting the first control signal, where the first control signal is used to turn on the temperature power supply, it further includes: Outputting a second control signal, where the second control signal is used to turn off the temperature power supply.
4. The multi-channel temperature measurement and calibration method according to claim 1, characterized in that, the using the calibration coefficient to correct each of the second temperature information one by one to obtain the final temperature of each temperature channel includes: Converting the second temperature information into a second AD information through an ADC converter; Calculating the internal resistance of the temperature measurement device by using a second calibration formula, where the second calibration formula is: In the formula, AD2 is the second AD information, N is the maximum range of the ADC converter, Rx is the internal resistance of the temperature measurement device, R2 is the standard voltage division resistance value, U2 is the standard temperature power supply voltage, U1 is the AD reference voltage, and K is the calibration coefficient; Obtaining the final temperature by looking up a table or interpolation according to the internal resistance of the temperature measurement device.
5. The multi-channel temperature measurement and calibration method according to claim 1, characterized in that, after using the calibration coefficient to correct each of the second temperature information one by one to obtain the final temperature of each temperature channel, it further includes: Storing the final temperature of each temperature channel into the memory built in the microcomputer.
6. A multi-channel temperature measurement and calibration system, characterized in that, the system includes: A temperature acquisition module for collecting multiple first temperature information at a first time; A coefficient calculation module, configured to enable a temperature channel and calculate a correction coefficient of the current temperature channel according to a temperature information, where the temperature channel refers to a channel that only passes one path of signal when there are multiple first temperature information; A channel switching module, configured to close the current temperature channel and switch to the next temperature channel until the correction coefficients of all temperature channels are calculated, where one of the correction coefficients corresponds to one of the first temperature information; The temperature acquisition module is further configured to acquire a plurality of second temperature information at a second time; The coefficient calculation module is further configured to correct each of the second temperature information one by one by using the correction coefficient to obtain the final temperature of each temperature channel; The coefficient calculation module is specifically configured to: Convert the first temperature information into a first AD information through an ADC converter; Calculate the correction coefficient of the temperature channel by using a first correction formula, where the first correction formula is: where AD1 is the first AD information, N is the maximum range of the ADC converter, R1 is the resistance value of the correction resistor, R2 is the standard voltage division resistance value, U2 is the standard voltage of the temperature power supply, U1 is the AD reference voltage, and K is the correction coefficient.
7. The multi-channel temperature measurement and correction system according to claim 6, characterized in that, further comprising: An IO port expansion module, configured to expand the data channel.
8. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded and executed by a processor to perform the method according to any one of claims 1 to 5.
9. An electronic device, characterized in that, comprising: A processor and a memory; wherein, the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
High-precision multi-channel synchronous acquisition system for temperature adaptive calibration
CN113765517A