STM32-based temperature compensation amplification circuit and use method
By designing a temperature compensation amplification circuit based on STM32, using the temperature measurement module and EEPROM memory to establish a temperature compensation data table, the problem of large output error of analog circuits at high and low temperatures in the prior art is solved, and high-precision analog output in the full temperature zone is realized.
Patent Information
- Application Number
- CN202411358720.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-28
AI Technical Summary
The error of the output of the analog circuit in the prior art at high and low temperatures is large, making it difficult to achieve high-precision analog output in the full temperature zone.
A temperature compensation amplifier circuit based on STM32 is designed, including a microcontroller STM32, a temperature measurement module, an EEPROM memory, a voltage measurement module, an operational amplifier circuit and a peripheral circuit. A temperature compensation data table is established through the temperature measurement module and an EEPROM memory to realize digital temperature compensation for the analog amplifier circuit.
The accuracy requirement of ±20mV analog output is realized within the full temperature range, which solves the problem of large output error of analog circuits at high and low temperatures. Its circuit is simple and the cost is low.
Smart Images

Figure CN119543842A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of aviation electromechanical atmospheric data systems, and in particular relates to a temperature compensation amplifier circuit based on STM32 and a use method thereof. The circuit can be used to realize high-precision analog output in the entire temperature range. Background Art
[0002] The atmospheric data system sensor collects the measured total pressure and measured static pressure of the aircraft. After correcting the measured static pressure, the corrected static pressure and dynamic pressure need to be converted into analog output to the flight control system for flight control rate calculation.
[0003] Usually, a single-chip microcomputer or DSP is used to convert the pressure into a digital quantity, which is then converted into an analog quantity by an external DA converter. The analog quantity is then amplified by an operational amplifier without temperature compensation. This method usually results in large errors in the analog quantity at high and low temperatures. Summary of the invention
[0004] The purpose of the present invention is to design a temperature compensation amplifier circuit based on STM32 and a use method thereof to solve the problem that the analog circuit output has large errors at high and low temperatures.
[0005] The present invention proposes a temperature compensation amplifier circuit based on STM32, comprising a single-chip microcomputer STM32, a temperature measurement module, an EEPROM memory, a pressure measurement module, two operational amplifier circuits and peripheral circuits, wherein the single-chip microcomputer STM32 comprises a timer, an A / D analog-to-digital converter, a solution module and a dual-channel D / A digital-to-analog converter, and a two-dimensional array of a temperature measurement module voltage VTemp-digital quantity Code-analog quantity is stored in the EEPROM memory; a pressure signal P is converted into a frequency signal f by the pressure measurement module and sent to a timer, and then sent to a solution module after conversion by the timer; the solution module obtains a temperature compensation signal by querying the two-dimensional array and interpolating, and sends the compensated digital signal to the operational amplifier circuit by the D / A digital-to-analog converter.
[0006] Advantageously, the D / A converter is 12 bits.
[0007] Advantageously, the input offset voltage of the operational amplifier circuit is lower than 75 μV, and the offset voltage drift is lower than 1 μV / °C.
[0008] Advantageously, the temperature measurement module adopts the temperature measurement element 2CK4148.
[0009] Advantageously, the calculation module can calculate a digital pressure signal and a digital voltage signal.
[0010] Advantageously, the temperature measurement module comprises a current limiting resistor and a temperature measurement diode.
[0011] The present invention also proposes a method for using a temperature compensation amplifier circuit based on STM32. The above-mentioned temperature compensation amplifier circuit is adopted. The method first establishes a two-dimensional array of temperature measurement module voltage VTemp-digital quantity Code-analog quantity, and stores it in the EEPROM memory; after the product enters the cycle operation, the pressure signal P is converted into a frequency signal f by the pressure measurement module and sent to the timer, which is then sent to the solution module after conversion by the timer. The solution module obtains the temperature compensation signal by querying the two-dimensional array and interpolating, and sends the compensated digital signal to the operational amplifier circuit by the D / A digital-to-analog converter.
[0012] Advantageously, when establishing a two-dimensional array of temperature measurement module voltage VTemp-digital quantity Code-analog quantity, a temperature point is set every 10°C in the temperature range of -55 to 85°C, and the temperature voltage VTemp output by the temperature measurement module at each temperature point is collected by the A / D analog-to-digital converter. At the same time, a six-and-a-half-digit digital multimeter is used to test the output static pressure analog quantity and dynamic pressure analog quantity, calculate and record the digital quantity Code corresponding to the static pressure analog quantity and the dynamic pressure analog quantity, and store the array data in the EEPROM memory.
[0013] Beneficial effects: Digital temperature compensation for analog amplifier circuits can be achieved. The product as a whole can meet the ±20mV analog output requirement within the full temperature range, solving the problem of large output error of the two-way DA in the full temperature range of the product. The circuit is simple and the cost is low.
[0014] The features, functions, and advantages that have been discussed can be achieved independently in various examples or may be combined in yet other examples. Further details of the examples can be seen with reference to the following description and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Examples, as well as preferred modes of use, other objects and description thereof, will be best understood by reference to the following detailed description of examples of the invention when read in conjunction with the accompanying drawings, in which:
[0016] Figure 1 It is a principle schematic diagram of the temperature compensation amplifier circuit of the present invention;
[0017] Figure 2 This is the circuit diagram of the temperature measurement module. DETAILED DESCRIPTION
[0018] The disclosed examples will be more fully described with reference to the accompanying drawings, in which some (but not all) of the disclosed examples are shown. In fact, many different examples may be described and these examples should not be construed as limited to the examples set forth herein. Instead, these examples are described so that this disclosure will be thorough and complete and will fully convey the scope of the disclosure to those skilled in the art.
[0019] like Figure 1 The temperature compensation amplifier circuit based on STM32 shown in the figure includes a single-chip STM32 (including a built-in A / D analog-to-digital converter, a 2-channel 12-bit D / A digital-to-analog converter and a timer), a temperature measurement module, an EEPROM memory, a pressure measurement module, two operational amplifier circuits (high precision, low temperature drift, low offset) and peripheral circuits. The input offset voltage of the amplifier circuit is lower than 75μV, and the offset voltage drift is lower than 1μV / ℃.
[0020] In this embodiment, the temperature measurement module adopts the temperature measurement element 2CK4148.
[0021] Among them, the pressure signal P is converted into a frequency signal f by the pressure measuring module, the frequency signal f sent by the pressure measuring module is collected by the timer of the single-chip microcomputer STM32, and converted into a digital pressure signal and a digital voltage signal by the solution module of the single-chip microcomputer STM32, and temperature compensation is performed by the temperature measuring module.
[0022] The digital quantity is sent to the 12-bit D / A digital-to-analog converter through the solution module, and a high-precision digital multimeter is used to collect the static pressure analog quantity and dynamic pressure analog quantity output by the analog amplifier circuit 1 and the analog amplifier circuit 2 respectively.
[0023] like Figure 2 The temperature measurement module circuit diagram shown in the figure includes a current limiting resistor R and a temperature measurement diode 1N4148. In the temperature range of (-55~85)℃, a temperature point is set every 10℃ (a total of 15 temperature points). The A / D analog-to-digital converter of the single-chip microcomputer STM32 is used to collect the temperature voltage VTemp output by the temperature measurement module at each temperature point. At the same time, a six-and-a-half-digit digital multimeter is used to test the static pressure analog quantity and dynamic pressure analog quantity output by the analog amplifier circuit 1 and the analog amplifier circuit 2 on the circuit board. The static pressure analog quantity and the dynamic pressure analog quantity are recorded respectively, and the digital quantity Code corresponding to the static pressure analog quantity and the dynamic pressure analog quantity is calculated and recorded. A two-dimensional array of temperature measurement module voltage VTemp-digital quantity Code-analog quantity is established, and the array data is stored in the EEPROM memory. The single-chip microcomputer STM32 solution module can read the calibration data in the EEPROM after the product is powered on.
[0024] After the product enters the cycle operation, the STM32 solution module collects the temperature voltage VTemp in real time through the internal A / D analog-to-digital converter in each cycle, calculates the analog value corresponding to the temperature voltage VTemp by linear interpolation through the table, and then calculates the corresponding digital value for temperature compensation.
[0025] Descriptions of different advantageous arrangements have been presented for purposes of illustration and description, but the description is not intended to be exclusive or limited to examples of the disclosed form. Many modifications and variations will be apparent to those of ordinary skill in the art. Additionally, different advantageous examples may be described as having different advantages over other advantageous examples. The selected example or examples are selected and described in order to best illustrate the principles of the examples, practical applications, and to enable those of ordinary skill in the art to understand the disclosure as having various examples with various modifications suitable for the particular use contemplated.
Claims
1. A temperature compensation amplifier circuit based on STM32, characterized in that: The invention comprises a single-chip microcomputer STM32, a temperature measurement module, an EEPROM memory, a pressure measurement module, two operational amplifier circuits and peripheral circuits, wherein the single-chip microcomputer STM32 comprises a timer, an A / D analog-to-digital converter, a solution module and a dual-channel D / A digital-to-analog converter, and a two-dimensional array of a temperature measurement module voltage VTemp-digital quantity Code-analog quantity is stored in the EEPROM memory; a pressure signal P is converted into a frequency signal f by the pressure measurement module and sent to the timer, and then sent to the solution module after conversion by the timer; the solution module obtains a temperature compensation signal by querying the two-dimensional array and interpolating, and sends the compensated digital signal to the operational amplifier circuit by the D / A digital-to-analog converter.
2. The temperature compensation amplifier circuit according to claim 1, characterized in that: The D / A digital-to-analog converter is 12 bits.
3. The temperature compensation amplifier circuit according to claim 1, characterized in that: The input offset voltage of the operational amplifier circuit is lower than 75 μV, and the offset voltage drift is lower than 1 μV / °C.
4. The temperature compensation amplifier circuit according to claim 1, characterized in that: The temperature measurement module adopts the temperature measurement element 2CK4148.
5. The temperature compensation amplifier circuit according to claim 1, characterized in that: The calculation module can calculate a digital pressure signal and a digital voltage signal.
6. The temperature compensation amplifier circuit according to claim 1, characterized in that: The temperature measurement module includes a current limiting resistor and a temperature measurement diode.
7. A method for using a temperature compensation amplifier circuit based on STM32, characterized in that: The method adopts the temperature compensation amplifier circuit described in any one of claims 1 to 6. The method first establishes a two-dimensional array of temperature measurement module voltage VTemp-digital quantity Code-analog quantity and stores it in the EEPROM memory; after the product enters cycle operation, the pressure measurement module converts the pressure signal P into a frequency signal f and sends it to the timer, which is then converted by the timer and sent to the solution module. The solution module obtains the temperature compensation signal by querying the two-dimensional array and interpolating, and sends the compensated digital signal to the operational amplifier circuit through the D / A digital-to-analog converter.
8. The method for using the temperature compensation amplifier circuit according to claim 7, characterized in that: When establishing a two-dimensional array of temperature measurement module voltage VTemp-digital quantity Code-analog quantity, a temperature point is set every 10°C in the temperature range of -55 to 85°C. The temperature voltage VTemp output by the temperature measurement module at each temperature point is collected by the A / D analog-to-digital converter. At the same time, a six-and-a-half-digit digital multimeter is used to test the output static pressure analog quantity and dynamic pressure analog quantity, calculate and record the digital quantity Code corresponding to the static pressure analog quantity and the dynamic pressure analog quantity, and store the array data in the EEPROM memory.