Calculation Method, Device, Equipment and Medium for Thermocouple or Resistance Thermometer Graduation Number
By adding the upper limit value to the microcontroller and calculating the linear equation using the two-point method, the Flash occupation and crash problems when the microcontroller calculates the thermocouple or thermoresistance index number are solved, and efficient and accurate temperature-resistance value or temperature-EMF correspondence calculation is achieved.
Patent Information
- Application Number
- CN202110063662.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-18
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2041-01-18
AI Technical Summary
In the prior art, when calculating thermocouple or thermoresistance indexing symbols, the microcontroller occupies a large Flash space and has a long calculation time, which is prone to crash, and the error accuracy cannot meet the needs.
By adding the upper limit value within the preset temperature interval, the linear equation is calculated using the two-point method, the temperature interval is separated, and the grouping error values are compared to determine the final temperature interval, reducing the number of functions and reducing the error.
It reduces the calculation time of microcontrollers, avoids crashes, reduces Flash occupation, and can accurately control the errors of temperature-resistance value or temperature-EMF to meet different accuracy requirements.
Smart Images

Figure CN114812866B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graduation number calculation, and particularly to a calculation method, device, equipment and medium for the graduation number of a thermocouple or a thermal resistor. Background Art
[0002] The graduation number is a standard sequence used to reflect the change in the voltage or resistance of a temperature sensor corresponding to the change in temperature within the measured temperature range, that is, the temperature values corresponding to the thermal resistor, thermocouple, resistance, and electromotive force. The letter symbol of the thermocouple type also becomes the graduation number, which is also the code of the thermocouple graduation table. The thermocouple graduation table refers to the relationship between the thermal electromotive force and the measured temperature in the form of a list under the condition that the reference end of the thermocouple is 0°C; the thermal resistor graduation table refers to the graduation characteristics of the thermal resistor represented in the form of a table, that is, the resistance-temperature conversion table. The accurate temperature-resistance and temperature-electromotive force correspondence relationships are given in the international standard, but self-made graduation tables are still required. There are mainly three reasons:
[0003] 1) Although the accurate temperature-resistance and temperature-electromotive force correspondence relationships are given in the international standard, for a single-chip microcomputer, writing all graduation numbers into the Flash is only a theoretically feasible solution. In fact, the size of the Flash limits this possibility. Therefore, seeking a new graduation table that occupies as little Flash as possible and can accurately reflect the temperature-resistance and temperature-electromotive force correspondence relationships has become an important research topic.
[0004] 2) If the single-chip microcomputer calculates the resistance or electromotive force using the temperature-resistance and temperature-electromotive force curves, situations such as crashing, greatly extended time, or simply being unable to operate will occur. Because the curves corresponding to the temperature-resistance and temperature-electromotive force are not low-degree functions, and some can reach high-degree functions of up to a dozen times, and the single-chip microcomputer cannot accurately process such functions.
[0005] 3) To enable the single-chip microcomputer to correctly process the curve correspondence relationship, the degree of the function must be reduced. The method of fitting can artificially reduce the degree of the function, but it is actually found that reducing the highest power of the function will amplify the error, which does not meet the accurate requirements. Summary of the Invention
[0006] In view of the above-mentioned disadvantages of the prior art, the purpose of the present application is to provide a calculation method, device, equipment and medium for the graduation number of a thermocouple or a thermal resistor to solve at least one problem in the prior art.
[0007] To achieve the above and other related objectives, the present application provides a method for calculating the thermocouple or thermal resistance graduation number. The method includes: S1. Increasing an upper limit value to the starting temperature value within a preset temperature range to obtain the upper limit temperature value respectively; S2. Calculating the electromotive force value / resistance value corresponding to each of the starting temperature value and the upper limit temperature value, and obtaining a linear equation according to the two-point method; S3. Dividing within the preset temperature range at a preset interval value to obtain grouped temperature values; S4. Substituting each grouped temperature value into the linear equation to obtain a reference value, calculating the electromotive force value / resistance value corresponding to each grouped temperature value as a standard value, and taking the absolute value of the difference between the reference value and the standard value as the grouping error value of each grouped temperature value; S5. Comparing the grouping error value with a preset maximum error value to determine the final temperature range.
[0008] In an embodiment of the present application, after the step S2, the method further includes: dividing the preset temperature range into multiple sections, and determining whether the second derivative of the electromotive force value curve / resistance value curve within each section is less than 0; if so, increasing a preset maximum error value to the electromotive force value / resistance value corresponding to the starting temperature value and / or the upper limit temperature value within this section, and updating the linear equation according to the two-point method; if not, continuing with step S3.
[0009] In an embodiment of the present application, the comparing the grouping error value with a preset maximum error value to determine the final temperature range includes: determining whether the grouping error value is less than the preset maximum error value; if so, increasing the upper limit temperature value by one or more of the interval values, and the final temperature range is from the initial temperature value to the upper limit temperature value + N interval values; if not, the final temperature range is from the starting temperature value to the upper limit temperature value.
[0010] In an embodiment of the present application, the increasing the upper limit temperature value by one or more of the interval values, and the final temperature range is from the initial temperature value to the upper limit temperature value + N interval values includes: increasing the upper limit temperature value by one of the interval values, calculating the electromotive force value / resistance value corresponding to it and each of the starting temperature values respectively, and updating the linear equation according to the two-point method; returning to steps S4 - S5 again until the grouping error value is not less than the preset maximum error value, then the final temperature range is from the initial temperature value to the upper limit temperature value + N interval values.
[0011] In an embodiment of the present application, the calculated electromotive force value / resistance value is obtained based on the temperature - electromotive force / temperature - resistance correspondence relationship in international standards.
[0012] In an embodiment of the present application, the method is applicable to the calculation of thermocouple graduation numbers or resistance thermometer graduation numbers; the thermocouple graduation numbers include any one or more of S, R, B, K, T, J, N, and E; the resistance thermometer graduation numbers include any one or more of Pt100, Pt10, Cu50, Cu100, and PT1000.
[0013] To achieve the above object and other related objects, the present application provides a device for calculating thermocouple or resistance thermometer graduation numbers, characterized in that the device includes: a first processing module for increasing an upper limit value to the starting temperature values within a preset temperature range to obtain upper limit temperature values respectively; calculating the electromotive force values / resistance values corresponding to each of the starting temperature values and the upper limit temperature values, and obtaining a linear equation according to the two-point method; a second processing module for dividing the preset temperature range at a preset interval value to obtain grouped temperature values; substituting each grouped temperature value into the linear equation to obtain a reference value, calculating the electromotive force value / resistance value corresponding to each grouped temperature value as a standard value, and taking the absolute value of the difference between the reference value and the standard value as the grouping error value of each grouped temperature value; a third processing module for comparing the grouping error value with a preset maximum error value to determine the final temperature range.
[0014] To achieve the above object and other related objects, the present application provides a computer device, the device includes: a memory and a processor; the memory is used to store computer instructions; the processor runs the computer instructions to implement the method as described above.
[0015] To achieve the above object and other related objects, the present application provides a computer-readable storage medium storing computer instructions, and the computer instructions are executed to implement the method as described above when running.
[0016] In summary, for a method, device, equipment, and medium for calculating thermocouple or resistance thermometer graduation numbers of the present application, by increasing an upper limit value to the starting temperature values within a preset temperature range to obtain upper limit temperature values respectively; calculating the electromotive force values / resistance values corresponding to each of the starting temperature values and the upper limit temperature values, and obtaining a linear equation according to the two-point method; dividing the preset temperature range at a preset interval value to obtain grouped temperature values; substituting each grouped temperature value into the linear equation to obtain a reference value, calculating the electromotive force value / resistance value corresponding to each grouped temperature value as a standard value, and taking the absolute value of the difference between the reference value and the standard value as the grouping error value of each grouped temperature value; comparing the grouping error value with a preset maximum error value to determine the final temperature range.
[0017] The present application has the following beneficial effects:
[0018] 1) It occupies less Flash and can accurately reflect the corresponding relationship between temperature and resistance value or temperature and electromotive force;
[0019] 2) It reduces the calculation time of the single-chip microcomputer and there will be no deadlock phenomenon;
[0020] 3) It can control the magnitude of the temperature-resistance value and temperature-electromotive force errors to meet the error precision requirements of different needs;
[0021] 4) By programming this method into a program, one-key operation can be achieved. Only some parameters need to be set, including: the starting point of temperature, the maximum error value, and the ending point of temperature. Moreover, the new graduation number and the error compared with the standard graduation number will be automatically obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It shows a schematic flowchart of the calculation method for the thermocouple or thermal resistance graduation number in an embodiment of the present application.
[0023] Figure 2 It shows a schematic model diagram of obtaining a linear equation by the two-point method in an embodiment of the present application.
[0024] Figure 3 It shows a schematic model diagram of increasing the maximum error value in an embodiment of the present application.
[0025] Figure 4A It shows a schematic model diagram of the comparison of the resistance errors at each temperature point between the new and old versions of PT100 in an embodiment of the present application.
[0026] Figure 4B It shows a schematic model diagram of the comparison of the temperature error curves between the new and old versions of PT100 in an embodiment of the present application.
[0027] Figure 5A It shows a schematic model diagram of the comparison of the electromotive force errors between the new and old versions of T-TC in an embodiment of the present application.
[0028] Figure 5B It shows a schematic model diagram of the comparison of the electromotive force errors between the new and old versions of E-TC in an embodiment of the present application.
[0029] Figure 5C It shows a schematic model diagram of the comparison of the electromotive force errors between the new and old versions of J-TC in an embodiment of the present application.
[0030] Figure 5D It shows a schematic model diagram of the comparison of the electromotive force errors between the new and old versions of K-TC in an embodiment of the present application.
[0031] Figure 6A It shows a schematic model diagram of the comparison of the temperature error curves between the new and old versions of T-TC in an embodiment of the present application.
[0032] Figure 6B It shows a schematic model diagram of the comparison of temperature error curves between the new and old versions of E-TC in an embodiment of the present application.
[0033] Figure 6C It shows a schematic model diagram of the comparison of temperature error curves between the new and old versions of J-TC in an embodiment of the present application.
[0034] Figure 6D It shows a schematic model diagram of the comparison of temperature error curves between the new and old versions of K-TC in an embodiment of the present application.
[0035] Figure 7 It shows a schematic module diagram of a calculation device for thermocouple or thermal resistance graduation numbers in an embodiment of the present application.
[0036] Figure 8 It shows a schematic structural diagram of a computer device in an embodiment of the present application. Specific embodiments
[0037] The following uses specific specific examples to illustrate the implementation manners of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0038] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner. Although only the components related to the present application are shown in the diagrams and are not drawn according to the number, shape, and size of the components in actual implementation, the types, quantities, and proportions of the components in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0039] Throughout the specification, when it is said that a certain part is "connected" to another part, this includes not only the case of "direct connection", but also the case of "indirect connection" where other elements are placed in between. In addition, when it is said that a certain part "includes" a certain component, unless there is a particularly contrary record, it does not exclude other components, but means that other components can also be included.
[0040] The first, second, third, etc. terms mentioned herein are used to illustrate various parts, components, regions, layers, and / or segments, but are not limited thereto. These terms are only used to distinguish one part, component, region, layer, or segment from other parts, components, regions, layers, or segments. Therefore, the first part, component, region, layer, or segment described below can refer to the second part, component, region, layer, or segment within the scope of this application without exceeding the scope of this application.
[0041] Furthermore, as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprising", "including" indicate the presence of the stated features, operations, elements, components, items, types, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, types, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or meaning any one or any combination. Thus, "A, B or C" or "A, B and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A, B and C". An exception to this definition only occurs when the combination of elements, functions, or operations is mutually exclusive in some way.
[0042] Although the accurate temperature-resistance and temperature-electromotive force correspondence relationships are given in international standards, for a single-chip microcomputer, there are still many problems in the calculation of thermocouple or thermal resistance graduation numbers. For this reason, this application proposes a calculation method, device, equipment, and medium for thermocouple or thermal resistance graduation numbers to solve the problem of large errors in electromotive force-temperature or resistance-temperature in previous old versions.
[0043] As Figure 1 shown, it is a schematic flowchart of a calculation method for thermocouple or thermal resistance graduation numbers in an embodiment of this application. As shown in the figure, the method includes:
[0044] Step S1: Add an upper limit value to the starting temperature value within a preset temperature range to obtain upper limit temperature values respectively.
[0045] In this application, adaptation conversion calculations applicable to a single-chip microcomputer can be performed for any desired temperature range. Assume the temperature range: [T1 - T2]. For example, t1 can be 0 and t2 can be 2.
[0046] Preferably, the upper limit value c does not exceed 1, such as 0.4 °C. Assume the starting temperature is i, then the current temperature upper and lower limits are [i, i + 0.4]
[0047] Step S2: Calculate the electromotive force values / resistance values corresponding to each of the starting temperature values and the upper limit temperature values respectively, and obtain a linear equation according to the two-point method.
[0048] In an embodiment of the present application, the calculated electromotive force value / resistance value is obtained according to the corresponding relationship between temperature - electromotive force / temperature - resistance in the international standard. That is, subsequent calculations of the electromotive force value / resistance value are also obtained according to the corresponding relationship between temperature - electromotive force / temperature - resistance in the international standard. Since the international standard gives the accurate corresponding relationship between temperature - resistance and temperature - electromotive force, the corresponding electromotive force or resistance can be obtained according to the known temperature.
[0049] Simply put, the linear equation obtained by the two - point method is obtained based on the relationship between the coordinates of two points.
[0050] As Figure 2 shown, the abscissa is the temperature value and the ordinate is the electromotive force value / resistance value.
[0051] Assume that the starting temperature in the temperature range is i °C, then the upper - limit temperature value is i + c °C; let x1 = i, then f1(x1) can represent the electromotive force value / resistance value corresponding to the starting temperature i; let x1 = i + c, then f2(x2) can represent the electromotive force value / resistance value corresponding to the starting temperature i + c;
[0052] Then two point coordinates are formed: [x1, f1(x1)], [x2, f2(x2)];
[0053] Furthermore, based on these two point coordinates, a linear equation can be obtained: F(x)=kx + b.
[0054] In an embodiment of the present application, after the step S2, the method further includes:
[0055] A. Divide the preset temperature range into multiple sections, and determine whether the second - order derivative of the electromotive force value curve / resistance value curve in each section is less than 0.
[0056] It should be noted that the electromotive force value / resistance value obtained within the preset temperature range according to the international standard presents as an electromotive force value curve / resistance value curve. By finding whether the second - order derivative is less than 0, mainly looking for whether a certain section of the curve is a convex function. According to the properties of the convex function, it will increase the data of the graduation mark points. Therefore, in this application, the convex - function section is found for special processing to reduce the number of graduation mark points and to expand the searched temperature range as much as possible.
[0057] B. If so, add the preset maximum error value max(error) to the electromotive force value / resistance value corresponding to the starting temperature value and / or the upper - limit temperature value in this section, and update the linear equation according to the two - point method; if not, continue with step S3.
[0058] It should be noted that the maximum error value here is set artificially according to requirements. For example, the maximum error value can be 0.001, preferably accurate to three decimal places.
[0059] Briefly speaking, when the convex function section is determined, a preset maximum error value is added to the electromotive force value / resistance value corresponding to the starting temperature value and / or upper limit temperature value within this section.
[0060] As Figure 3 shown, the slope of the original linear equation F(x)=kx + b is moved upward by a distance of the maximum error value max(error) in the coordinate system. After the movement, the distance between the slope and the electromotive force value curve / resistance value curve actually decreases. In other words, compared with the old version of the traditional method, the new version of the method in this application has reduced error, and the curve determined by two points is longer. Therefore, this application can expand the range by increasing the maximum error value. And after adding the maximum error value to the original linear equation, the number of segments it can be divided into will decrease, and correspondingly, the probability of adding error will also decrease, thereby improving the accuracy.
[0061] Step S3: Divide within a preset temperature range at a preset interval value to obtain grouped temperature values;
[0062] For example, the interval value here mainly segments integer temperature values. For example, if the interval value is 0.2 °C, it can be subdivided into 5 segments, which helps to further refine the error of each segment.
[0063] Step S4: Substitute each grouped temperature value into the linear equation to obtain a reference value, calculate the electromotive force value / resistance value corresponding to each grouped temperature value as a standard value, and take the absolute value of the difference between the reference value and the standard value as the grouped error value of each grouped temperature value;
[0064] Step S5: Compare the grouped error value with the preset maximum error value to determine the final temperature range.
[0065] In an embodiment of this application, step S5 specifically includes:
[0066] A. Judge whether the grouped error value is less than the preset maximum error value;
[0067] B. If so, increase the upper limit temperature value by one or more of the interval values, and the final temperature range is from the initial temperature value to the upper limit temperature value + N interval values;
[0068] Among them, it mainly includes:
[0069] B1. Increase the upper limit temperature value by one of the interval values, calculate the electromotive force value / resistance value corresponding to it and each of the starting temperature values respectively, and update the linear equation according to the two-point method;
[0070] B2. Return to steps S4 - S5 again until the grouped error value is not less than the preset maximum error value, then the final temperature range is from the initial temperature value to the upper limit temperature value + N interval values.
[0071] C. If not, then the final temperature range is from the starting temperature value to the upper limit temperature value.
[0072] In an embodiment of the present application, the method is applicable to the calculation of thermocouple graduation numbers or resistance thermometer graduation numbers; the thermocouple graduation numbers include any one or more of: S, R, B, K, T, J, N, and E; the resistance thermometer graduation numbers include any one or more of: Pt100, Pt10, Cu50, Cu100, and PT1000.
[0073] For example, the present application is illustrated by the following embodiments:
[0074] Assume the temperature range: [t1 - t2].
[0075] step1: Set the starting temperature, for example, i°C; then execute i + 0.4 = 0.4°C, that is, 0.4°C is the assumed temperature upper limit c, so the temperature upper and lower limits are [i, i + 0.4];
[0076] step2: Find the electromotive force value f1(x1) corresponding to x1 = i, and f2(x2) corresponding to x2 = i + 0.4. From the two - point coordinates [x1, f1(x1)], [x2, f2(x2)], use the two - point method to find the linear equation: F(x) = kx + b.
[0077] step3: Divide the preset temperature range [t1 - t2] into multiple sections. If the second derivative of the electromotive force value curve / resistance value curve between the sections [t3 - t4] is less than 0, it can be known that this section of the curve is a convex function. According to the properties of the convex function, to maximize the optimal temperature range as much as possible, a maximum error value max(error) can be added, that is, f1 + max(error), f2 + max(error) are obtained. Then, using [x1, f1 + max(error)], [x2, f2 + max(error)], update F(x) = kx + b by the two - point method to maximize the temperature range as much as possible; otherwise, go to step5.
[0078] step4: Divide the preset temperature range [t1 - t2] at a preset interval value. For example, to obtain grouped temperature values, for example, the interval value is 0.2°C.
[0079] Step 5: Starting from the initial temperature x = i, at intervals of 0.2 °C, i.e., x = i + 0.2, solve for the corresponding reference value F1 of F(x) = kx + b and find the standard value F2 based on the correspondence with the international standard. Therefore, the grouping error value corresponding to x = i + 0.2 is: error(i + 0.2) = abs(F1 - F2);
[0080] Step 6: If error(i + 0.2) < max(error) is satisfied, then increase the temperature upper limit by 0.2 °C, i.e., continue to advance 0.2 °C forward. Then, based on [x1, f1(x1)] and [x2 + 0.2, f2(x2 + 0.2)], update F(x) = kx + b using the two-point method, and then continue to execute Step 5 until error(i + 0.2) < max(error) is no longer satisfied. Then the final temperature range is [i, i + 0.4 + N × 0.2]; if it is not satisfied (not satisfied from the beginning), then the final temperature range is [i, i + 0.4].
[0081] Target result: Using the new calculation method of this application and the traditional old method for common thermocouple graduation numbers: S, R, B, K, T, J, N, E types and common thermal resistance graduation numbers: Pt100, Pt10, Cu50, Cu100, PT1000, etc., the new graduation number calculation method ensures the smallest error in the correspondence between resistance-temperature and electromotive force-temperature, and can achieve the expected effect.
[0082] It should be noted that the specific steps of the method described in this application mainly refer to the process of how to calculate the thermocouple or thermal resistance graduation number on a single-chip microcomputer. However, the technical effects presented on the single-chip microcomputer cannot be intuitively reflected. By comparing the calculation results of the new version and the traditional old version of this method, the technical effects achieved by this application can be more intuitively reflected. [[ID=!]]
[0083] In this embodiment, the new thermocouple or thermal resistance graduation number calculation method proposed in this application is used to calculate different types of thermocouple and thermal resistance graduation numbers, and the graduation number errors calculated by the old method are compared. The results are as follows.
[0084] 1) Thermal resistance PT100
[0085] For the thermal resistance PT100, the accuracy requirement is that the resistance value corresponding to each point and the resistance value calculated from the standard curve have an error less than 2 mΩ. The temperature range is: -200 - 850 °C. The errors at each temperature point are as Figure 4AAs shown. Among them, Curve 1 is the electromotive force error per degree Celsius calculated by the new method within the temperature range of -200 - 850 °C, and Curve 2 is the electromotive force error per degree Celsius in the old version within the temperature range of -200 - 850 °C. It should be noted that since Curve 1 and Curve 2 cannot be distinguished by color, their distinction cannot be visually seen, but in this application, they can be distinguished by the height, frequency, and continuous change trend of the curves. For example, Curve 1 corresponds to the new version, and its curve height is low, while Curve 2 corresponds to the old version, and its curve height is high. The attached drawings given below can also distinguish Curve 1 and Curve 2 according to this feature.
[0086] Among them, the errors in the figure are all the errors compared with the standard curves of GB / T 16839.1 - 2018 or GBT 30121 - 2013. The new graduation number calculation method is compiled into a program using Matlab, hereinafter referred to as the new version. And it is compared with the old calculation method, hereinafter referred to as the old version.
[0087] Table 1 shows the comparison of the maximum errors and the number of graduation numbers between the new and old versions of PT100.
[0088]
[0089] As can be seen from Table 1, the maximum error within the temperature range is 2 mΩ. The maximum error of the old version is 11 mΩ, and the accuracy is improved by 81.9%.
[0090] When the error is less than or equal to 2 mΩ, the temperature error at each point within the temperature range can be obtained by reverse lookup as Figure 4B shown.
[0091] From Figure 4B it can be seen that the maximum temperature error of the old version of the thermal resistor PT100 is 0.3 °C, and the maximum temperature error of the new version is less than 0.0068 °C, and the accuracy is improved by 97.73%, which is significantly higher than the accuracy of the old version. It meets the requirements.
[0092] 2) Thermocouple
[0093] 2.1) Comparison and analysis of electromotive force error
[0094] Through program control, 4 points are inserted per degree Celsius in the thermocouple of the new version. To ensure the best Flash, the electromotive force error of each point is preferably less than or equal to 1.5 μV or 2 μV or 1 μV, and the error is compared with the old version as Figures 5A - 5D shown. Among them, the X-axis: temperature / °C, the Y-axis: electromotive force / μV.
[0095] Table 2 shows the comparison of the maximum errors and the number of graduation numbers between the new and old versions of various types of thermocouples.
[0096]
[0097] From Table 2 Figures 5A - 5D The following shows: ① The TTC's accuracy has increased by 75.4% compared to the previous version, a significant improvement. However, the FLASH usage has only increased by 6%, meeting both accuracy and FLASH requirements. The ETC's accuracy has increased by 79.6% compared to the previous version, while the FLASH usage has also decreased by 6%, demonstrating significant improvements in both metrics. ② The accuracy of the other two thermocouple types has also improved. A comprehensive comparison shows that the new version's calibration is significantly superior to the previous version's.
[0098] 2.2) Temperature Error Comparison and Analysis
[0099] The temperature error of each point can be obtained by reverse lookup table. Figures 6A - 6D shown.
[0100] Curve 1 in the figure shows the temperature error of the new version, while Curve 2 shows the temperature error of the old version. It can be seen that across most temperature ranges, the temperature error of the new version is significantly smaller than that of the old version. Although the error is slightly larger in the negative temperature range, this temperature range is not frequently used in normal use and has little impact. This comprehensive comparison shows that the new version's calibration is significantly superior to the old version's.
[0101] In summary, the calculation method of the thermocouple or thermal resistor graduation number described in this application has the following advantages:
[0102] (1) It occupies less Flash memory and can accurately and compatibly reflect the corresponding relationship between temperature and resistance or temperature and electromotive force.
[0103] (2) The calculation time of the microcontroller is reduced and no freeze occurs.
[0104] (3) The size of the temperature-resistance and temperature-electromotive force errors can be controlled to meet the error accuracy requirements of different requirements;
[0105] (4) This method can be programmed to achieve one-click operation. Only some parameters need to be set, including the temperature starting point, the maximum error, and the temperature end point. The new graduation number and the error compared with the standard graduation number can be automatically obtained.
[0106] like Figure 7 FIG. 7 is a block diagram of a device for calibrating intrinsic parameters of an event camera according to an embodiment of the present invention. As shown in the figure, the device 700 includes:
[0107] The first processing module 701 is configured to add an upper limit value to each starting temperature value within a preset temperature range to obtain an upper limit temperature value; calculate the electromotive force value / resistance value corresponding to each starting temperature value and the upper limit temperature value, and obtain a linear equation based on the two-point method;
[0108] A second processing module 702, configured to perform separation at a preset interval within a preset temperature range to obtain grouped temperature values; substitute each grouped temperature value into a linear equation to obtain a reference value, and calculate an electromotive force value / resistance value corresponding to each grouped temperature value as a standard value, and use the absolute value of the difference between the reference value and the standard value as the grouping error value of each grouped temperature value;
[0109] A third processing module 703, configured to compare the grouping error value with a preset maximum error value to determine a final temperature range.
[0110] It should be noted that for the information interaction, execution process, etc. between the above-mentioned device modules / units, since they are based on the same concept as the method embodiment of the present application, the technical effects brought by them are the same as those of the method embodiment of the present application. For specific content, reference can be made to the description in the method embodiment shown above in the present application, and details are not described herein again.
[0111] It should also be noted that it should be understood that the division of each module of the above device 700 is only a logical function division. In actual implementation, it can be fully or partially integrated into a physical entity, or physically separated. And these units can all be implemented in the form of software called by a processing element; they can also all be implemented in hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in hardware. For example, the third processing module 703 can be a separately established processing element, or can be integrated in a certain chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a certain processing element of the above device to perform the functions of the above third processing module 703. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together or independently implemented. The processing element mentioned here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the hardware integrated logic circuit or software-form instructions in the processor element.
[0112] For example, the above modules may be one or more integrated circuits configured to implement the above methods. For example: one or more Application Specific Integrated Circuits (ASICs); or, one or more digital signal processors (DSPs); or, one or more Field Programmable Gate Arrays (FPGAs), etc.; Another example is that when a certain module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code; Another example is that these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0113] As Figure 8 shown, it is a schematic structural diagram of a computer device in an embodiment of the present application. As shown in the figure, the computer device 800 includes: a memory 801 and a processor 802; the memory 801 is used to store computer instructions; the processor 802 runs the computer instructions to implement as Figure 1 the method described above.
[0114] In some embodiments, the number of the memories 801 in the computer device 800 can be one or more, and the number of the processors 802 can also be one or more, while Figure 8 one is taken as an example in both cases.
[0115] In an embodiment of the present application, the processor 802 in the computer device 800 will load the instructions corresponding to the processes of one or more application programs into the memory 801 according to the steps as Figure 1 described above, and the processor 802 will run the application programs stored in the memory 801, so as to implement as Figure 1 the method described above.
[0116] The memory 801 may include a Random Access Memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The memory 801 stores an operating system and operation instructions, executable modules or data structures, or subsets thereof, or extended sets thereof. Among them, the operation instructions may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
[0117] The processor 802 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0118] In some specific applications, the components of the computer device 800 are coupled together through a bus system, which may include a power bus, a control bus, a status signal bus, etc. in addition to the data bus. However, for the sake of clarity, in Figure 8 all kinds of buses are referred to as the bus system.
[0119] In an embodiment of the present application, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the method as Figure 1 described.
[0120] At any possible combination level of technical details, the present application may be a system, a method, and / or a computer program product. The computer program product may include a computer-readable storage medium, on which computer-readable program instructions for causing a processor to implement various aspects of the present application are loaded.
[0121] A computer-readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium can be, for example, (but is not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanically encoded device, such as a punched card or raised structures in grooves having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium as used herein is not construed as being an instantaneous signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.
[0122] The computer-readable programs described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device. The computer program instructions for performing the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user computer, partially on the user computer, executed as a stand-alone software package, partially on the user computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., by using an Internet service provider to connect via the Internet). In some embodiments, by using the status information of the computer-readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of the present application.
[0123] In summary, a method, device, equipment, and medium for calculating the graduation number of a thermocouple or thermal resistor provided by the present application obtain upper limit temperature values by adding an upper limit value to the starting temperature values within a preset temperature range; calculate the electromotive force values / resistance values corresponding to each of the starting temperature values and the upper limit temperature values, and accordingly obtain a linear equation according to the two-point method; divide the preset temperature range at a preset interval value to obtain grouped temperature values; substitute each grouped temperature value into the linear equation to obtain a reference value, calculate the electromotive force value / resistance value corresponding to each grouped temperature value as a standard value, and use the absolute value of the difference between the reference value and the standard value as the grouped error value of each grouped temperature value; compare the grouped error value with a preset maximum error value to determine the final temperature range.
[0124] The present application effectively overcomes various drawbacks in the prior art and has high industrial utilization value.
[0125] The above embodiments are only illustrative of the principles and effects of the present application and are not intended to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical idea disclosed by the present invention should still be covered by the claims of the present application.
Claims
1. A method for calculating the graduation number of a thermocouple or thermal resistor, characterized in that: The method comprises: S1, adding an upper limit value to the starting temperature value within the preset temperature range to obtain an upper limit temperature value; S2. Calculate the electromotive force value / resistance value corresponding to each of the starting temperature values and the upper limit temperature value, and obtain a linear equation based on the two-point method; divide the preset temperature range into multiple segments, and determine whether the second-order derivative of the electromotive force value curve / resistance value curve in each segment is less than 0; if so, add a preset maximum error value to the electromotive force value / resistance value corresponding to the starting temperature value and / or the upper limit temperature value in the segment, and update the linear equation based on the two-point method; if not, proceed to step S3; S3. Separate the preset temperature range according to the preset interval value to obtain grouped temperature values; S4. Substitute the temperature value of each group into the linear equation to obtain a reference value, and calculate the electromotive force value / resistance value corresponding to the temperature value of each group as a standard value, and use the absolute value of the difference between the reference value and the standard value as the group error value of each group temperature value; S5. Compare the grouping error value with a preset maximum error value to determine a final temperature range.
2. The method according to claim 1, characterized in that The comparing the grouping error value with a preset maximum error value to determine a final temperature range includes: Determining whether the grouping error value is less than a preset maximum error value; If yes, the upper limit temperature value is increased by one or more of the interval values, and the final temperature interval is from the initial temperature value to the upper limit temperature value + N interval values; if no, the final temperature interval is from the starting temperature value to the upper limit temperature value.
3. The method according to claim 2, characterized in that The step of increasing the upper limit temperature value by one or more of the interval values, wherein the final temperature range is from the initial temperature value to the upper limit temperature value + N interval values, includes: The upper limit temperature value is increased by the interval value, and the electromotive force value / resistance value corresponding to each of the starting temperature values is calculated, and the linear equation is updated according to the two-point method; Return to steps S4-S5 until the group error value is not less than the preset maximum error value, and the final temperature interval is the initial temperature value to the upper limit temperature value + N interval values.
4. The method according to any one of claims 1 to 3, characterized in that The calculated electromotive force values / resistance values are obtained based on the corresponding relationship between temperature-electromotive force / temperature-resistance in international standards.
5. The method according to claim 1, wherein The method is applicable to the calculation of thermocouple graduation numbers or thermal resistor graduation numbers; the thermocouple graduation numbers include any one or more of S, R, B, K, T, J, N, and E; the thermal resistor graduation numbers include any one or more of Pt100, Pt10, Cu50, Cu100, and PT1000.
6. A device for calculating the graduation number of a thermocouple or thermal resistor, characterized in that: The device comprises: A first processing module is configured to add an upper limit value to a starting temperature value within a preset temperature range to obtain an upper limit temperature value; calculate the electromotive force value / resistance value corresponding to each of the starting temperature values and the upper limit temperature value, and thereby obtain a linear equation according to a two-point method; divide the preset temperature range into a plurality of segments, and determine whether the second-order derivative of the electromotive force value curve / resistance value curve within each segment is less than 0; if so, add a preset maximum error value to the electromotive force value / resistance value corresponding to the starting temperature value and / or the upper limit temperature value within the segment, and thereby update the linear equation according to the two-point method; if not, proceed to execute the second processing module; A second processing module is configured to separate the temperature values into grouped values according to a preset interval value within a preset temperature range; substitute each grouped temperature value into a linear equation to obtain a reference value; calculate the electromotive force value / resistance value corresponding to each grouped temperature value as a standard value; and use the absolute value of the difference between the reference value and the standard value as a grouping error value for each grouped temperature value; The third processing module is configured to compare the grouping error value with a preset maximum error value to determine a final temperature range.
7. A computer device, characterized in that: The device comprises: a memory and a processor; the memory is used to store computer instructions; the processor executes the computer instructions to implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that Computer instructions are stored, and when the computer instructions are executed, the method according to any one of claims 1 to 5 is performed.