Temperature compensation method and system based on temperature and pressure zoning
By constructing a temperature-pressure zoned compensation data grid and using an interpolation algorithm, the problem of high-precision temperature compensation for pressure transmitters over a wide temperature range was solved, achieving efficient and accurate temperature compensation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 星奇(上海)半导体有限公司
- Filing Date
- 2026-03-27
- Publication Date
- 2026-05-29
AI Technical Summary
In the existing technology, it is difficult to achieve high-precision temperature compensation for pressure transmitters over a wide temperature range, and the four-point compensation method is difficult to obtain ideal compensation effect in the entire temperature range and full range when the linearity of the core is not ideal.
A temperature compensation method based on temperature and pressure partitioning is adopted. By constructing a compensation data grid and using an interpolation algorithm to calculate the compensated pressure value, dense multi-point calibration is reduced, and calibration efficiency and accuracy are improved.
It achieves high-precision temperature compensation over a wide temperature range, reduces calibration workload and time costs, improves compensation accuracy and efficiency, and enables millisecond-level real-time processing.
Smart Images

Figure CN122108435A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of sensor signal processing technology, and in particular to a temperature compensation method and system based on temperature and pressure partitioning. Background Technology
[0002] In the field of pressure transmitters, temperature compensation is a key technical aspect for ensuring the accuracy of pressure measurements. As the sensing element, the output characteristics of the pressure core drift with changes in ambient temperature. Without compensation, this will lead to significant errors in the measurement results. In related technologies, pressure transmitters typically employ a four-point compensation method, which involves calibration compensation at four pressure points: zero and full scale under low and high pressure conditions. This method is simple in structure and easy to implement, and is widely used in applications requiring general accuracy. However, this method places high demands on the linearity of the pressure core. When the core's linearity is not ideal, relying solely on calibration data from four points is insufficient to achieve satisfactory compensation across the entire temperature range and measurement range. For high-precision pressure transmitters, especially in applications requiring high measurement accuracy over a wide temperature range, achieving high-precision and high-efficiency temperature compensation is a pressing technical problem that needs to be solved. Summary of the Invention
[0003] This disclosure provides a temperature compensation method and system based on temperature and pressure zoning. The technical solution of this disclosure is as follows: In a first aspect, this disclosure provides a temperature compensation method based on temperature and pressure zoning, including: Obtain the current temperature and pressure values from the pressure transmitter; Based on the current temperature value and the current pressure value, a corresponding target grid area is determined in a preset compensation data grid, wherein the compensation data grid consists of multiple temperature-pressure intervals, and each temperature-pressure interval corresponds to a set of calibration compensation data; Based on the calibration compensation data corresponding to the target grid region, the compensated pressure value corresponding to the current temperature value and the current pressure value is calculated using an interpolation algorithm.
[0004] In one possible implementation, prior to acquiring the current temperature and current pressure values of the pressure transmitter, the process includes: In response to calibration commands, it sequentially enters multiple preset temperature-pressure ranges; Within each temperature-pressure range, acquire the externally input standard pressure value and standard temperature value, and record the currently acquired pressure core output analog quantity and temperature sensor reading; The acquired standard pressure value, standard temperature value, analog output of the pressure core, and temperature sensor reading are used as calibration compensation data and saved to the memory to construct a compensation data grid.
[0005] In one possible implementation, the step of sequentially entering multiple preset temperature-pressure ranges in response to a calibration command includes: After entering a preset temperature range, multiple different pressure values are applied sequentially within that temperature range to traverse multiple pressure ranges.
[0006] In one possible implementation, calculating the compensated pressure value corresponding to the current temperature value and the current pressure value using an interpolation algorithm includes: Using a two-dimensional linear interpolation algorithm, the compensated pressure value is calculated based on the calibration compensation data corresponding to the four vertices of the target grid region.
[0007] In one possible implementation, the step of using a two-dimensional linear interpolation algorithm to calculate the compensated pressure value based on the calibration compensation data corresponding to the four vertices of the target mesh region includes: Based on the calibration compensation data corresponding to the four vertices of the target grid region, linear interpolation is performed along the pressure axis and the temperature axis to obtain the compensated pressure value corresponding to any point inside the target grid region. Among them, the linear interpolation along the pressure axis is used to determine the compensation value corresponding to different pressure points within the target temperature range; the linear interpolation along the temperature axis is used to determine the compensation value corresponding to different temperature points within the target pressure range.
[0008] In one possible implementation, the number of interval divisions on the temperature axis and the number of interval divisions on the pressure axis in the compensation data grid are predetermined based on the operating range and accuracy requirements of the pressure transmitter.
[0009] Secondly, this disclosure provides a temperature compensation system based on temperature and pressure zoning, including: Pressure core circuit, used to convert pressure signals into electrical signals; The temperature sampling circuit is used to acquire the collected temperature signal and process the temperature signal to eliminate the influence of fluctuations and obtain an effective temperature signal. Non-volatile memory is used to store compensation data grids, which consist of multiple temperature-pressure intervals, each temperature-pressure interval corresponding to a set of calibration compensation data; A microcontroller is connected to the pressure core circuit, the temperature sampling circuit, and the non-volatile memory, respectively. The microcontroller is used to acquire the current temperature value and the current pressure value; determine the corresponding target grid region in the compensation data grid based on the current temperature value and the current pressure value; and calculate the compensated pressure value corresponding to the current temperature value and the current pressure value using an interpolation algorithm based on the calibration compensation data corresponding to the target grid region.
[0010] In one possible implementation, it also includes: Communication circuit, used to communicate with the host computer and receive calibration messages; The microcontroller is also configured to enter a calibration mode in response to the calibration message, in which: It sequentially enters multiple preset temperature-pressure zones; Within each temperature-pressure range, the standard pressure value and standard temperature value input from the outside are acquired through the communication circuit, and the current pressure core output analog quantity output by the pressure core circuit and the temperature sensor reading output by the temperature sampling circuit are recorded. The acquired standard pressure value, standard temperature value, analog output of the pressure core, and temperature sensor reading are used as calibration compensation data and saved to the non-volatile memory to construct the compensation data grid.
[0011] In one possible implementation, it also includes: An analog output circuit, connected to the microcontroller, is used to output an analog signal that is proportional to the compensated pressure value.
[0012] In one possible implementation, it also includes: The display driving circuit, connected to the microcontroller, is used to drive the LED dot matrix display to show real-time pressure information.
[0013] The technical solution disclosed in this paper brings at least the following beneficial effects: In the embodiments of this disclosure, the current temperature and pressure values of the pressure transmitter are acquired; based on the current temperature and pressure values, a corresponding target grid region is determined in a preset compensation data grid, wherein the compensation data grid consists of multiple temperature-pressure intervals, each temperature-pressure interval corresponding to a set of calibration compensation data; based on the calibration compensation data corresponding to the target grid region, an interpolation algorithm is used to calculate the compensated pressure value corresponding to the current temperature and pressure values. In this way, a two-dimensional temperature-pressure compensation data grid can be constructed, decomposing the global nonlinear temperature-pressure characteristics into locally linearized regions. Thus, on the one hand, dense multi-point calibration is unnecessary across the entire range; calibration data from a limited number of grid nodes can cover the entire temperature-pressure operating condition, significantly reducing calibration workload and time costs, improving calibration efficiency and accuracy, and thus effectively improving compensation accuracy and efficiency; on the other hand, using grid region rapid positioning and simple interpolation calculations to replace complex global model calculations can also achieve millisecond-level real-time processing while ensuring compensation accuracy, effectively reducing computational resource consumption.
[0014] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0016] Figure 1 A schematic flowchart of a temperature compensation method based on temperature and pressure zoning provided in this disclosure embodiment; Figure 2 A schematic flowchart of another temperature compensation method based on temperature and pressure zoning provided in this disclosure embodiment; Figure 3 A schematic diagram of a temperature-pressure range provided in an embodiment of this disclosure; Figure 4 A schematic diagram of a temperature compensation system based on temperature and pressure zoning provided in this disclosure embodiment; Figure 5 A flowchart illustrating the pressure calibration mode provided in this embodiment of the disclosure; Figure 6 A normal mode workflow diagram provided for embodiments of this disclosure; Figure 7 A schematic diagram of the compensation calculation method provided in the embodiments of this disclosure. Detailed Implementation
[0017] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0018] To facilitate understanding of the technical solutions disclosed herein, the following terms are first defined: Temperature-pressure range: A temperature-pressure zone refers to a rectangular area enclosed by two adjacent temperature boundaries and two adjacent pressure boundaries. Specifically, the operating temperature range of a pressure transmitter is divided into multiple temperature zones, and the pressure measurement range is divided into multiple pressure zones. Each temperature zone and each pressure zone are combined to form multiple grid-like regions, and each region is a temperature-pressure zone.
[0019] Compensation data grid: The compensation data grid refers to a two-dimensional grid-like data structure composed of the aforementioned multiple temperature-pressure ranges. The temperature axis of this grid represents the operating temperature range of the pressure transmitter, and the pressure axis represents the pressure measurement range. Each grid node (i.e., the intersection of each temperature and pressure range) corresponds to a set of calibration compensation data, which includes the standard pressure value, standard temperature value, pressure core output analog quantity, and temperature sensor reading collected at that node. The compensation data grid can be a regular grid (i.e., temperature and pressure ranges are divided at equal intervals) or an irregular grid (i.e., not equally spaced according to actual needs).
[0020] Relationship between compensation data grid and temperature-pressure range: The compensation data grid consists of multiple temperature-pressure intervals, which are related as a whole to a part. Specifically, the compensation data grid is a global division of the entire working area, while each temperature-pressure interval is a basic unit within the compensation data grid. In normal operating mode, the pressure transmitter first locates its temperature-pressure interval (i.e., the target grid area) based on the current temperature and pressure values. Then, using the calibration compensation data of the four vertices of this interval, it calculates the compensated pressure value at the current point through an interpolation algorithm.
[0021] A temperature compensation method and system based on temperature and pressure zoning according to an embodiment of the present disclosure is described below with reference to the accompanying drawings.
[0022] Figure 1 This is a schematic flowchart illustrating a temperature compensation method based on temperature and pressure zoning provided in an embodiment of this disclosure. Figure 1 As shown, the method includes the following steps: S101, obtain the current temperature and pressure values of the pressure transmitter.
[0023] In embodiments of this disclosure, the microcontroller can acquire the current temperature value through a temperature sampling circuit and the current pressure value through a pressure core circuit. The temperature sampling circuit is used to collect temperature signals and process them to eliminate the influence of fluctuations and obtain an effective temperature signal; the pressure core circuit is used to convert the pressure signal into an electrical signal.
[0024] S102, based on the current temperature and pressure values, determine the corresponding target grid area in the preset compensation data grid.
[0025] The compensation data grid consists of multiple temperature-pressure ranges, with each temperature-pressure range corresponding to a set of calibration compensation data.
[0026] In the embodiments of this disclosure, the compensation data grid consists of multiple temperature-pressure intervals, each corresponding to a set of calibration compensation data. The number of interval divisions on the temperature axis and the number of interval divisions on the pressure axis in the compensation data grid can be predetermined according to the operating range and accuracy requirements of the pressure transmitter. For example, when the operating range is large or the accuracy requirement is high, the number of interval divisions on the temperature axis and the pressure axis can be increased to improve the compensation accuracy.
[0027] S103, based on the calibration compensation data corresponding to the target grid area, uses an interpolation algorithm to calculate the compensated pressure value corresponding to the current temperature value and the current pressure value.
[0028] In the embodiments of this disclosure, the microcontroller obtains the calibration compensation data corresponding to the four vertices of the target grid region in the compensation data grid based on the current temperature and pressure values. It then uses an interpolation algorithm to calculate the compensated pressure value at the current point. This compensated pressure value can be further converted into an analog signal proportional to the pressure via an analog output circuit, or displayed on an LED (light-emitting diode) dot matrix via a display driver circuit.
[0029] In the embodiments of this disclosure, the current temperature and pressure values of the pressure transmitter are acquired; based on the current temperature and pressure values, a corresponding target grid region is determined in a preset compensation data grid, wherein the compensation data grid consists of multiple temperature-pressure intervals, each temperature-pressure interval corresponding to a set of calibration compensation data; based on the calibration compensation data corresponding to the target grid region, an interpolation algorithm is used to calculate the compensated pressure value corresponding to the current temperature and pressure values. In this way, a two-dimensional temperature-pressure compensation data grid can be constructed, decomposing the global nonlinear temperature-pressure characteristics into locally linearized regions. Thus, on the one hand, dense multi-point calibration is unnecessary across the entire range; calibration data from a limited number of grid nodes can cover the entire temperature-pressure operating condition, significantly reducing calibration workload and time costs, improving calibration efficiency and accuracy, and thus effectively improving compensation accuracy and efficiency; on the other hand, using grid region rapid positioning and simple interpolation calculations to replace complex global model calculations can also achieve millisecond-level real-time processing while ensuring compensation accuracy, effectively reducing computational resource consumption.
[0030] In some possible implementations, before acquiring the current temperature and current pressure values of the pressure transmitter, the following steps are included: In response to calibration commands, it sequentially enters multiple preset temperature-pressure ranges; Within each temperature-pressure range, acquire the externally input standard pressure value and standard temperature value, and record the currently acquired pressure core output analog quantity and temperature sensor reading; The acquired standard pressure value, standard temperature value, analog output of the pressure core, and temperature sensor reading are used as calibration compensation data and saved to non-volatile memory to construct a compensation data grid.
[0031] In this embodiment, the calibration command can be triggered by a calibration message sent by a host computer through a communication circuit. In practical applications, the calibration command can also be triggered by local key input on the pressure transmitter, touchscreen operation, or remote server commands. It is understood that the specific source of the calibration command is not limited; any control signal capable of triggering the pressure transmitter to enter calibration mode can be used as a calibration command. After the pressure transmitter is powered on, the microcontroller can determine the current operating mode. When a calibration message sent by the host computer is received through the communication circuit, the microcontroller responds to the calibration message and enters calibration mode. The calibration message may contain parameter information such as a calibration start command, the number of preset temperature ranges, and the number of pressure points corresponding to each temperature range. The communication circuit can use industrial fieldbus communication methods such as RS485 (recommended standard 485), CAN (Controller Area Network), and HART (Hardware Addressable Remote Sensor High-Speed Channel), and the calibration message is encapsulated and parsed according to the corresponding communication protocol.
[0032] In calibration mode, the microcontroller monitors the current temperature value in real time through a temperature sampling circuit. An external temperature control device (such as a custom heating strip) heats or cools the pressure transmitter according to a preset temperature range, stabilizing the ambient temperature within the target range. For example, a custom heating strip wrapped around the pressure transmitter housing provides excellent temperature control and energy efficiency, enabling rapid heating and stable temperature maintenance. When the temperature signal collected by the temperature sampling circuit fluctuates less than a preset threshold (e.g., ±0.5℃) within a preset time, the microcontroller determines that the temperature has stabilized and sends a temperature stabilization notification to the host computer via a communication circuit.
[0033] After the temperature stabilizes, the external calibration equipment applies multiple different pressure values sequentially to the pressure transmitter through pipelines. Calibration operators or automated calibration systems output standard pressure values one by one according to the preset pressure point sequence. For example, within a certain temperature range, six pressure points can be set, applied sequentially from low to high pressure. At each pressure point, once the pressure stabilizes, the external calibration equipment sends a calibration data message containing the standard pressure and temperature values to the pressure transmitter via a host computer.
[0034] Within each temperature-pressure range, when the microcontroller receives a calibration data message from the host computer, it acquires the standard values: parsing the externally input standard pressure and standard temperature values from the calibration data message. The standard pressure value is provided by an external high-precision pressure standard, and the standard temperature value is provided by an external high-precision temperature standard, serving as the reference values for calibration. It records its own acquired values: the microcontroller acquires the current analog output of the pressure core through the pressure core circuit and the current temperature sensor reading through the temperature sampling circuit. The analog output of the pressure core is the value obtained after the pressure core converts the pressure signal into an electrical signal and then processes it through amplification and filtering. The temperature sensor reading is the value obtained after processing the original temperature signal acquired by the temperature sensor. Data association and storage: the microcontroller associates the acquired standard pressure and standard temperature values with its own acquired analog output of the pressure core and temperature sensor readings to form a set of calibration compensation data. This set of data reflects the correspondence between the pressure transmitter's own output and the standard value at the current temperature-pressure point.
[0035] The microcontroller saves the generated calibration compensation data to non-volatile memory. For example, the non-volatile memory can be an EEPROM (Electrically Erasable Programmable Read-Only Memory) or FLASH (Flash Memory) to ensure that the data is not lost after power failure. The calibration compensation data is stored in a storage matrix according to temperature-pressure coordinates, forming a node of the compensation data grid.
[0036] Once all preset pressure points within the current temperature range have completed the aforementioned calibration data acquisition and storage, the microcontroller sends a calibration completion notification to the host computer via the communication circuit. Subsequently, the external temperature control device adjusts the temperature to the next preset temperature range, repeating the process.
[0037] Once all preset temperature-pressure ranges have been calibrated, the microcontroller sends a calibration completion notification to the host computer via the communication circuit. At this point, the non-volatile memory has stored a complete compensation data grid, which consists of multiple temperature-pressure ranges, each corresponding to a set of calibration compensation data. The microcontroller exits calibration mode and automatically returns to normal operating mode, awaiting subsequent normal operating commands.
[0038] In some possible implementations, in response to a calibration command, the system sequentially enters multiple preset temperature-pressure ranges, including: After entering a preset temperature range, multiple different pressure values are applied sequentially within that temperature range to traverse multiple pressure ranges.
[0039] In this embodiment, a current temperature range is established. An external temperature control device (such as a customized heating belt) heats or cools the pressure transmitter, causing the ambient temperature of the pressure transmitter to enter the first preset temperature range. When the temperature signal collected by the temperature sampling circuit fluctuates less than a preset threshold within a preset time, the microcontroller determines that the temperature has stabilized and prepares to perform pressure calibration within that temperature range.
[0040] Within the current temperature range, the pressure range is traversed. After the temperature stabilizes, an external calibration device sequentially applies multiple different pressure values to the pressure transmitter through pipelines to traverse all pressure ranges within the temperature range. For example, standard pressure values are applied one by one according to a preset pressure point sequence (e.g., from low pressure to high pressure). At each pressure point, once the pressure stabilizes, the external calibration device sends a calibration message containing the standard pressure and temperature values to the pressure transmitter via a host computer. The microcontroller responds to this message, acquires and stores the current pressure core output analog quantity and temperature sensor reading, completing the calibration for that pressure point. This process is repeated until all preset pressure points within the current temperature range have been calibrated.
[0041] Moving to the next temperature range, once the current temperature range is calibrated, the external temperature control device adjusts the temperature to the next preset temperature range. After the temperature stabilizes, the above steps are repeated, traversing all preset pressure ranges again within the new temperature range. This process is continued until all preset temperature ranges have been calibrated.
[0042] In some possible implementations, a two-dimensional linear interpolation algorithm is used to calculate the compensated pressure value based on the calibration compensation data corresponding to the four vertices of the target mesh region, including: Based on the calibration compensation data corresponding to the four vertices of the target grid region, linear interpolation is performed along the pressure axis and temperature axis respectively to obtain the compensated pressure value corresponding to any point within the target grid region. Specifically, linear interpolation along the pressure axis is used to determine the compensation value corresponding to different pressure points within the target temperature range; linear interpolation along the temperature axis is used to determine the compensation value corresponding to different temperature points within the target pressure range.
[0043] In this embodiment, the data of the four vertices of the target mesh region are acquired, a first linear interpolation is performed along the pressure axis, and a second linear interpolation is performed along the temperature axis, outputting the compensation result. Interpolation is performed first along the pressure axis, then along the temperature axis; the compensation value for any point within the target mesh region can be obtained through these two linear interpolations. This algorithm has low computational complexity and high speed, making it suitable for real-time operation on embedded platforms such as microcontrollers (MCUs). It can meet the real-time requirements of pressure transmitters while ensuring compensation accuracy. When the temperature-pressure range is sufficiently finely divided, the nonlinearity of the local region can be approximated as linear, and the interpolation result can achieve high compensation accuracy.
[0044] In some possible implementations, the number of interval divisions on the temperature axis and the number of interval divisions on the pressure axis in the compensation data grid are predetermined based on the operating range and accuracy requirements of the pressure transmitter.
[0045] In this embodiment of the disclosure, the number of interval divisions on the temperature axis and the number of interval divisions on the pressure axis are predetermined based on the following factors: Operating Range: When the pressure transmitter operates over a wide temperature range, the number of temperature intervals on the temperature axis needs to be increased to ensure minimal temperature variation within each interval, thus improving temperature compensation. For example, a temperature range of -40℃ to 85℃ can be divided into 12 temperature intervals (each interval being 10℃); while a temperature range of 0℃ to 50℃ can be satisfied with 5 temperature intervals. Similarly, when the pressure transmitter has a wide measurement range, the number of pressure intervals on the pressure axis needs to be increased to ensure minimal pressure variation within each pressure interval.
[0046] Accuracy requirement level: When high accuracy is required for pressure measurement, it is necessary to increase the number of intervals on the temperature and pressure axes, and use finer grid nodes to make the interpolation results more accurate. For example, for a high-precision pressure transmitter with 0.1%FS, a 10×10 grid can be set; while for a normal-precision pressure transmitter with 1%FS, a 5×5 grid is sufficient.
[0047] Nonlinearity of the pressure core: When the nonlinearity of the pressure core is not ideal, the number of intervals on the pressure axis can be increased, and the nonlinear characteristics of the core can be compensated through multi-point calibration. For example, for a core with poor linearity, the pressure axis can be divided into more than 10 intervals; while for a core with good linearity, 3-5 intervals are sufficient.
[0048] To make the method provided in this disclosure clearer, the temperature compensation method based on temperature and pressure zoning will be described in detail below with reference to the following examples, such as... Figure 2 As shown, the following processes are included: S201, after the pressure transmitter is powered on and reset, the microcontroller determines the current operating mode.
[0049] For example, the pressure transmitter automatically enters normal operating mode after power-on. When a calibration message from the host computer needs to be received via the communication circuit, the microcontroller responds to the calibration message and enters calibration mode.
[0050] S202, in calibration mode, responds to calibration commands and sequentially enters multiple preset temperature-pressure ranges.
[0051] For example, the calibration operator establishes a stable temperature zone using an external temperature control device (such as a custom heating belt). Once the temperature feedback indicates stability, the operator enters a preset temperature range. Within this range, multiple different pressure values are sequentially applied through the calibration equipment piping to traverse multiple pressure zones. For instance, six pressure points are set in each temperature zone for calibration. After calibration of one zone is complete, the process moves to the next zone, repeating the six-point calibration until all preset temperature-pressure ranges are calibrated. The temperature-pressure ranges are as follows: Figure 3 As shown.
[0052] S203 acquires the standard pressure value and standard temperature value input from the outside within each temperature-pressure range, and records the currently acquired analog output of the pressure core and the temperature sensor reading.
[0053] For example, once the temperature and pressure are stable, the microcontroller obtains the standard pressure and standard temperature values sent by the host computer through the communication circuit, and simultaneously acquires the analog output of the pressure core circuit and the temperature sensor reading output by the temperature sampling circuit.
[0054] S204 uses the acquired standard pressure value, standard temperature value, pressure core output analog quantity, and temperature sensor reading as calibration compensation data, and saves them to non-volatile memory to construct a compensation data grid.
[0055] For example, the microcontroller smooths the collected standard pressure value, standard temperature value, analog output from the pressure core, and temperature sensor readings, then records them into a storage matrix according to the pressure-temperature coordinates and saves them to non-volatile memory (such as EEPROM or FLASH). After all temperature-pressure ranges are calibrated, a calibration completion message is displayed, and the calibration mode is exited.
[0056] S205, in normal operating mode, acquires the current temperature and pressure values.
[0057] For example, the pressure transmitter automatically resumes normal operation mode after power-on reset. The microcontroller obtains the current temperature value through the temperature sampling circuit and the current pressure value through the pressure core circuit.
[0058] S206, Based on the current temperature value and the current pressure value, determine the corresponding target grid area in the preset compensation data grid.
[0059] For example, the microcontroller locates its target grid region within the compensation data grid based on the current temperature and pressure values. The compensation data grid consists of multiple temperature-pressure ranges stored in the calibration mode.
[0060] S207, Based on the calibration compensation data corresponding to the target grid region, a two-dimensional linear interpolation algorithm is used to calculate the compensated pressure value according to the calibration compensation data corresponding to the four vertices of the target grid region.
[0061] For example, the microcontroller uses the interp2 algorithm for interpolation calculations. Wherein, Indicates temperature The lower pressure output analog quantity is The corresponding compensated pressure value. The calculation formula is as follows: First, according to isobaric surfaces and , Find the intersection of the isothermal surfaces. and :
[0062]
[0063] Among them, P1 and P2 are two adjacent standard pressure settings in the stepped pressure sequence set in calibration mode.
[0064] Then, according to Find the intersection of the isobaric surface and the three-dimensional surface of the compensation value. :
[0065] When the temperature-pressure range is sufficiently small, the equivalent surface projection is approximately linear, and the deviation of the pressure compensation value calculated by the above two-dimensional linear interpolation can meet the accuracy requirements.
[0066] S208 outputs the compensated pressure value.
[0067] Specifically, the microcontroller converts the calculated compensated pressure value into an analog signal proportional to the pressure through an analog output circuit, and simultaneously drives an LED dot matrix display to show the real-time pressure information through a display driver circuit.
[0068] This disclosure provides a temperature compensation system based on temperature and pressure zoning, such as... Figure 4 As shown, Figure 4 This is a schematic diagram of a temperature compensation system structure based on temperature and pressure zoning provided in an embodiment of this disclosure. See also... Figure 4 A temperature compensation system based on temperature and pressure zones may include: The pressure core circuit is used to convert pressure signals into electrical signals. Specifically, the pressure core circuit uses a pressure core as a sensing element. When external pressure is applied to the pressure core, the pressure core converts the pressure signal into a weak electrical signal output.
[0069] The temperature sampling circuit is used to acquire the collected temperature signal and process it to eliminate the influence of fluctuations and obtain a valid temperature signal. Specifically, the temperature sampling circuit is connected to the temperature sensor, acquires the collected temperature signal from the temperature sensor at a fixed period, and performs filtering, amplification, and other processing on the temperature signal to eliminate the influence of fluctuations and obtain a valid temperature signal.
[0070] A non-volatile memory is used to store a compensation data grid, which consists of multiple temperature-pressure ranges, each corresponding to a set of calibration compensation data. Specifically, the non-volatile memory can be a storage device such as EEPROM or FLASH, used to save the calibration compensation data collected in calibration mode, ensuring that the data is not lost after power failure.
[0071] The microcontroller is connected to the pressure core circuit, temperature sampling circuit, and non-volatile memory. The microcontroller is used to implement all signal processing programs, communication programs, numerical read / write programs, and calibration control for multiple temperature-pressure ranges. The microcontroller is configured to perform the following steps: acquire the current temperature and pressure values; determine the corresponding target grid region in the compensation data grid based on the current temperature and pressure values; and calculate the compensated pressure value corresponding to the current temperature and pressure values using an interpolation algorithm based on the calibration compensation data corresponding to the target grid region.
[0072] The communication circuit, connected to the microcontroller, enables communication with the host computer. Specifically, the communication circuit receives calibration messages sent by the host computer and transmits standard pressure and temperature values to the microcontroller. In calibration mode, the microcontroller responds to the calibration messages, enters calibration mode, and obtains externally input standard pressure and temperature values through the communication circuit. The communication circuit can use industrial fieldbus communication methods such as RS485, CAN, and HART, or other wired or wireless communication methods.
[0073] The analog output circuit, connected to the microcontroller, is used to output an analog signal proportional to the compensated pressure value. Specifically, the analog output circuit converts the compensated pressure value calculated by the microcontroller into a standard analog signal output, such as a 4-20mA current signal or a 0-10V voltage signal, to facilitate interfacing with external control systems (such as PLCs (Programmable Logic Controllers), DCS (Distributed Control Systems), etc.).
[0074] The display driver circuit, connected to the microcontroller, drives the display device to show real-time pressure information. Specifically, the display driver circuit can be an LED dot matrix driver circuit, used to drive the LED dot matrix to display the real-time pressure value. In one specific embodiment, the LED dot matrix can be a 3.5-digit dot matrix, used to display pressure values with a precision of three and a half digits.
[0075] The dry contact circuit, connected to the microcontroller, is used to output switching signals. Specifically, the dry contact circuit outputs switching signals according to the control of the microcontroller to indicate the status information of the pressure transmitter, such as pressure over-limit alarm, on / off status, etc.
[0076] The power supply circuit is used to power each module and provide power input to the load. Specifically, the power supply circuit connects to an external power source and converts the external power input voltage into the operating voltage required by each module, providing a stable operating power supply for modules such as the pressure core circuit, temperature sampling circuit, microcontroller, communication circuit, analog output circuit, display driver circuit, and dry contact circuit.
[0077] To make the temperature compensation method based on temperature and pressure zoning provided in this disclosure clearer, the specific steps are as follows: This embodiment employs a temperature-pressure range calibration method. For cores with low nonlinearity, the number of temperature and pressure axial calibration points is reduced; for cores with less than ideal nonlinearity, the number of temperature and pressure axial calibration points is increased. Considering the MCU processing speed, numerical calculation tools (such as MATLAB) can be used to obtain the fitting curve using Lagrange interpolation formulas. The results can be obtained by embedding the formula or directly using an automatic step calibration program for comprehensive multi-point calibration, with local linear interpolation. This embodiment uses the Interp2 algorithm for interpolation fitting, as shown in the following formula:
[0078] in, , These represent the pressure and temperature values for the corresponding temperature-pressure grid. , These are the pressure and temperature values of the corresponding pressure grid collected, respectively; Z is the pre-calibrated target pressure value at the temperature-pressure grid point, which is the calibration reference value used for compensation. This is a bilinear interpolation method.
[0079] The technical solutions provided by the embodiments of this disclosure are described below with reference to the accompanying drawings.
[0080] This embodiment also provides a pressure transmitter, including: a sampling circuit, a power supply circuit, an MCU and its peripheral circuits, and a drive circuit.
[0081] The sampling circuit is used to acquire temperature signals from the temperature sensor at fixed intervals, and to process the temperature signals to eliminate the influence of fluctuations and obtain effective temperature signals. MCU is used to implement communication, display, data processing, temperature compensation, and data storage.
[0082] Specifically, by collecting sufficient data in a grid manner, the output polynomial is fitted or a compensation matrix is constructed to achieve temperature-pressure range compensation for pressure values. (See attached image) Figure 5 As shown, in calibration mode, the calibration operator provides a stepped temperature zone. At the same temperature, the stepped pressure is given sequentially through the calibration equipment pipeline. In calibration mode, after the pressure transmitter tests stable pressure and temperature values under each temperature-pressure grid it passes through, the smoothed temperature-pressure values are entered into the storage matrix according to the pressure-temperature coordinates. After the operation of different temperature steps is completed, the calibration is completed and the calibration mode is exited.
[0083] In this embodiment, under normal mode, the collected data is processed into signals and then fed into the corresponding grid for compensation calculation, outputting the compensated pressure value Pco.
[0084] The display driver circuit is used for driving LED dot matrix displays. In this embodiment, a 3.5-bit dot matrix driver is used. The power supply circuit is used to supply power to each module.
[0085] The embodiments in this manual are used for temperature compensation calibration of pressure transmitters. By inputting a stepped temperature, the transmitter output voltage at different pressures at each temperature is collected and saved to the grid data. After the collection is completed, the interp2 algorithm is used to add interpolation and fit the compensation surface.
[0086] In normal working mode, such as Figure 6 As shown, in this embodiment, the compensation value is obtained by calculating the surface formed by adjacent intervals based on the surface lattice obtained after interpolation. The method of obtaining is as follows Figure 7 As shown, Indicates temperature Below, the analog pressure output is The corresponding adjusted pressure values are shown in this figure.
[0087]
[0088]
[0089] The projections of the compensation value three-dimensional surface onto the isothermal and isobaric surfaces are both straight lines, according to... Isobaric surfaces, compensation value three-dimensional surfaces and , Find the intersection of isothermal surfaces. ,and Subsequently, according to The intersection line of the isobaric surface and the three-dimensional surface of the compensation value is obtained. The compensation results show that within a sufficiently small temperature-pressure range, the equivalent surface projection is approximately linear, and the pressure compensation value deviation can meet the accuracy requirements.
[0090] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0091] Embodiments of this disclosure also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0092] Embodiments of this disclosure also provide a computer-readable storage medium storing a computer program configured to perform the steps in any of the above method embodiments when executed.
[0093] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0094] Embodiments of this disclosure also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0095] Embodiments of this disclosure also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0096] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0097] The method provided in this disclosure has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this disclosure. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this disclosure without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this disclosure.
Claims
1. A temperature compensation method based on temperature and pressure zoning, characterized in that, include: Obtain the current temperature and pressure values from the pressure transmitter; Based on the current temperature value and the current pressure value, a corresponding target grid area is determined in a preset compensation data grid, wherein the compensation data grid consists of multiple temperature-pressure intervals, and each temperature-pressure interval corresponds to a set of calibration compensation data; Based on the calibration compensation data corresponding to the target grid region, the compensated pressure value corresponding to the current temperature value and the current pressure value is calculated using an interpolation algorithm.
2. The temperature compensation method based on temperature and pressure zoning according to claim 1, characterized in that, Before acquiring the current temperature and pressure values of the pressure transmitter, the process also includes: In response to calibration commands, it sequentially enters multiple preset temperature-pressure ranges; Within each temperature-pressure range, acquire the externally input standard pressure value and standard temperature value, and record the currently acquired pressure core output analog quantity and temperature sensor reading; The acquired standard pressure value, standard temperature value, analog output of the pressure core, and temperature sensor reading are used as calibration compensation data and saved to the memory to construct a compensation data grid.
3. The temperature compensation method based on temperature and pressure zoning according to claim 2, characterized in that, In response to the calibration command, the system sequentially enters multiple preset temperature-pressure ranges, including: In response to the calibration command, after entering a preset temperature range, multiple different pressure values are applied sequentially within that temperature range to traverse multiple pressure ranges.
4. The temperature compensation method based on temperature and pressure zoning according to claim 1, characterized in that, The step of calculating the compensated pressure value corresponding to the current temperature value and the current pressure value using an interpolation algorithm includes: Using a two-dimensional linear interpolation algorithm, the compensated pressure value is calculated based on the calibration compensation data corresponding to the four vertices of the target grid region.
5. The temperature compensation method based on temperature and pressure zoning according to claim 4, characterized in that, The step of using a two-dimensional linear interpolation algorithm to calculate the compensated pressure value based on the calibration compensation data corresponding to the four vertices of the target grid region includes: Based on the calibration compensation data corresponding to the four vertices of the target grid region, linear interpolation is performed along the pressure axis and the temperature axis to obtain the compensated pressure value corresponding to any point inside the target grid region. Among them, the linear interpolation along the pressure axis is used to determine the compensation value corresponding to different pressure points within the target temperature range; the linear interpolation along the temperature axis is used to determine the compensation value corresponding to different temperature points within the target pressure range.
6. The temperature compensation method based on temperature and pressure zoning according to claim 1, characterized in that, In the compensation data grid, the number of interval divisions on the temperature axis and the number of interval divisions on the pressure axis are predetermined based on the working range and accuracy requirements of the pressure transmitter.
7. A temperature compensation system based on temperature and pressure zoning, characterized in that, include: Pressure core circuit, used to convert pressure signals into electrical signals; The temperature sampling circuit is used to acquire the collected temperature signal and process the temperature signal to eliminate the influence of fluctuations and obtain an effective temperature signal. A memory is used to store a compensation data grid, which consists of multiple temperature-pressure intervals, each temperature-pressure interval corresponding to a set of calibration compensation data; A microcontroller is connected to the pressure core circuit, the temperature sampling circuit, and the memory, respectively. The microcontroller is used to acquire the current temperature value and the current pressure value; and to determine the corresponding target grid region in the compensation data grid based on the current temperature value and the current pressure value. Based on the calibration compensation data corresponding to the target grid region, the compensated pressure value corresponding to the current temperature value and the current pressure value is calculated using an interpolation algorithm.
8. The temperature compensation system based on temperature and pressure zoning according to claim 7, characterized in that, Also includes: Communication circuit, used to communicate with the host computer and receive calibration messages; The microcontroller is also configured to enter a calibration mode in response to the calibration message, in which: It sequentially enters multiple preset temperature-pressure zones; Within each temperature-pressure range, the standard pressure value and standard temperature value input from the outside are acquired through the communication circuit, and the current pressure core output analog quantity output by the pressure core circuit and the temperature sensor reading output by the temperature sampling circuit are recorded. The acquired standard pressure value, standard temperature value, analog output of the pressure core, and temperature sensor reading are used as calibration compensation data and saved to the non-volatile memory to construct the compensation data grid.
9. The temperature compensation system based on temperature and pressure zoning according to claim 7, characterized in that, Also includes: An analog output circuit, connected to the microcontroller, is used to output an analog signal that is proportional to the compensated pressure value.
10. The temperature compensation system based on temperature and pressure zoning according to claim 7, characterized in that, Also includes: The display driving circuit, connected to the microcontroller, is used to drive the LED dot matrix display to show real-time pressure information.