Voltage correction method, device and electronic equipment
By testing and calculating the correction value, taking into account factors such as temperature and service life, the output digital signal of the sensor is corrected, which solves the problem of the logarithmic amplifier output voltage deviating from the ideal curve and improves the accuracy of the current conversion voltage.
Patent Information
- Application Number
- CN202210124060.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-10
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-02-10
AI Technical Summary
In the prior art, the output voltage of the logarithmic amplifier of the sensor is affected by interference from non-ideal factors such as noise and offset, causing the output voltage to deviate from the ideal logarithmic curve, affecting the accuracy.
By testing the digital signals corresponding to the two correction currents, calculate the correction value, and considering factors such as temperature and service life during the correction process, the correction value is used to correct the correspondence between the output digital signal and the output current, thereby improving the accuracy of the current conversion voltage.
It effectively eliminates noise, offset and other interference from logarithmic amplifiers, improves the accuracy of the output voltage, and makes it closer to the ideal output voltage.
Smart Images

Figure CN114485761B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of integrated circuits, and in particular to a voltage correction method, device and electronic equipment. Background Art
[0002] Sensing technology can usually convert different physical parameters into electric current, such as photoelectric sensing, pressure sensing, temperature sensing, etc. The existing technology often converts the converted current into voltage through a logarithmic amplifier, and then converts the voltage into a digital signal through an analog-to-digital converter, and transmits it to the subsequent controller to manipulate and process the detection data output by the ADC.
[0003] However, in actual applications, the logarithmic amplifier is interfered by non-ideal factors such as noise and offset, and the sensor is also interfered by non-ideal factors such as input resistance, which causes the output voltage of the logarithmic op amp to deviate from the ideal logarithmic curve, affecting the accuracy of the output voltage. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, device and electronic device for voltage correction, which can test the digital signals corresponding to two currents and calculate the correction value. During the correction process, the correction chip can be corrected taking into account factors such as temperature and service life, thereby providing an effective way to improve the accuracy of current-to-voltage conversion.
[0005] In a first aspect, an embodiment of the present invention provides a method for voltage correction, wherein the method is applied to a correction chip, the correction chip comprising a logarithmic amplifier, and a current input module and an analog-to-digital converter connected to the logarithmic amplifier; the method comprises: inputting a first correction current into the logarithmic amplifier to obtain a first correction voltage, and inputting a second correction current into the logarithmic amplifier to obtain a second correction voltage; inputting the first correction voltage into the analog-to-digital converter to obtain a first correction digital signal, and inputting the second correction voltage into the analog-to-digital converter to obtain a second correction digital signal; calculating a correction value based on the first correction digital signal and the second correction digital signal; passing the output current of the current input module through the logarithmic amplifier and the analog-to-digital converter respectively to obtain an output digital signal corresponding to the output current; correcting the correspondence between the output digital signal and the output current using the correction value; calculating the output digital signal according to the correspondence between the corrected output digital signal and the output current; and calculating the output voltage corresponding to the output current according to the obtained output digital signal.
[0006] In combination with the first aspect, an embodiment of the present invention provides a first possible implementation of the first aspect, wherein the logarithmic amplifier includes a first buck element, a second buck element and a comparator, the negative input terminal of the comparator is connected to the current input module, the positive input terminal of the comparator is connected to the reference voltage, the anode of the first buck element is connected to the negative input terminal of the comparator, the cathode of the first buck element is connected to the output terminal of the comparator, the cathode of the second buck element is connected to the output terminal of the comparator, the anode of the second buck element is connected to the reference current and output voltage terminal, and the positive input terminal of the comparator is also connected to the external node voltage source; the first correction voltage and the second correction voltage are obtained by the following formula:
[0007] V X =V ref +V inc +V T ln(I ref / I X )
[0008] Among them, V X is the correction voltage corresponding to the correction current, V ref is the reference voltage, V inc is the node voltage, V T is the thermal voltage due to the temperature difference between two points, I ref is the reference current, I X To correct the current.
[0009] In combination with the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the step of inputting the first correction voltage into the analog-to-digital converter to obtain the first correction digital signal, and the step of inputting the second correction voltage into the analog-to-digital converter to obtain the second correction digital signal comprises: obtaining the first correction digital signal and the second correction digital signal according to the corresponding relationship between the first correction voltage and the second correction voltage and the number of bits of the analog-to-digital converter, the reference level, and the first correction digital signal and the second correction digital signal; the following formula is the corresponding relationship between the correction voltage and the number of bits of the analog-to-digital converter, the reference level, and the correction digital signal:
[0010] V out =amboutx / 2 N×AVDD
[0011] Wherein, amboutx is the calibration signal, N is the number of bits of the analog-to-digital converter, and AVDD is the reference level of the analog-to-digital converter.
[0012] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the step of calculating the correction value based on the first correction digital signal and the second correction digital signal includes: inputting the first correction digital signal into the first output model to obtain a first relationship about the correction value, and inputting the second correction digital signal into the first output model to obtain a second relationship about the correction value; wherein the first output model is used to characterize the corresponding relationship between the change of the correction digital signal with temperature and the correction current; the following formula is the first output model:
[0013]
[0014] The first relational expression and the second relational expression are solved together to obtain a correction value;
[0015] Among them, I ref is the reference current, T c is the temperature coefficient of the reference current when the temperature changes, ΔT is the temperature change, T is the current temperature value, α and β are both correction values, amboutx is the correction signal, N is the number of bits of the analog-to-digital converter, and I X To correct the current.
[0016] In combination with the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein the current input module pre-stores a current conversion efficiency table, and the current conversion efficiency table stores a proportional coefficient of the output current output by the current input module at different temperatures and the output current output at a standard temperature; based on the steps of respectively passing the output current of the current input module through a logarithmic amplifier and an analog-to-digital converter to obtain an output digital signal corresponding to the output current, the steps include: obtaining the proportional coefficient of the output current output by the current input module at different temperatures and the output current output at a standard temperature; obtaining the output current at a current temperature based on the output current output at the standard temperature; and respectively passing the output current of the current input module through a logarithmic amplifier and an analog-to-digital converter to obtain an output digital signal corresponding to the output current.
[0017] In combination with the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the correction chip also includes a reference current generating module, the reference current generating module is connected to the anode of the second step-down element, and is used to generate a reference current, and the method includes: generating a reference current at different temperatures that fits the proportional coefficient of the output current at different temperatures to the output current at the standard temperature.
[0018] In a second aspect, an embodiment of the present invention also provides a voltage correction device, characterized in that the device is applied to a correction chip, the correction chip includes a logarithmic amplifier, and a current input module and an analog-to-digital converter connected to the logarithmic amplifier; the device includes: a current input module, used to input a first correction current into the logarithmic amplifier to obtain a first correction voltage, and input a second correction current into the logarithmic amplifier to obtain a second correction voltage; an analog-to-digital converter, used to input the first correction voltage into the analog-to-digital converter to obtain a first correction digital signal, and input the second correction voltage into the analog-to-digital converter to obtain a second correction digital signal; a calculation module, used to calculate a correction value based on the first correction digital signal and the second correction digital signal; the analog-to-digital converter, also used to obtain an output digital signal corresponding to the output current by passing the output current of the current input module through the logarithmic amplifier and the analog-to-digital converter respectively; the correction module, used to correct the correspondence between the output digital signal and the output current using the correction value; the calculation module, also used to calculate the output digital signal according to the correspondence between the corrected output digital signal and the output current; the calculation module, also used to calculate the output voltage corresponding to the output current according to the obtained output digital signal.
[0019] In combination with the second aspect, an embodiment of the present invention provides a second possible implementation of the second aspect, wherein the analog-to-digital converter is further used to obtain the first correction digital signal and the second correction digital signal according to the correspondence between the first correction voltage and the second correction voltage and the number of bits input to the analog-to-digital converter, the reference level, and the first correction digital signal and the second correction digital signal; the calculation module is further used to input the first correction digital signal into the first output model to obtain a first relationship about the correction value, and input the second correction digital signal into the first output model to obtain a second relationship about the correction value; wherein the first output model is used to characterize the correspondence between the change of the correction digital signal with temperature and the correction current; the current input module is further used to obtain an output digital signal corresponding to the output current based on the output current of the current input module passing through a logarithmic amplifier and an analog-to-digital converter respectively, including: obtaining a proportionality coefficient between the output current output by the current input module at different temperatures and the output current output at the standard temperature; obtaining the output current at the current temperature based on the output current output at the standard temperature; obtaining the output digital signal corresponding to the output current by passing the output current of the current input module through a logarithmic amplifier and an analog-to-digital converter respectively; a reference current generation module is used to generate a reference current at different temperatures that fits the proportionality coefficient between the output current at different temperatures and the output current at the standard temperature.
[0020] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory, the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above method.
[0021] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above method.
[0022] The embodiments of the present invention bring the following beneficial effects:
[0023] The embodiments of the present application provide a method, device and electronic device for voltage correction, wherein two correction currents are respectively connected to a logarithmic amplifier to obtain two corresponding correction voltages, and the two correction voltages are input into an analog-to-digital converter to obtain two corresponding correction digital signals, and correction values are calculated based on the two correction signals, and the corresponding relationship between the output digital and the output current is corrected using the correction value, and the output digital signal is calculated based on the corrected corresponding relationship, and the output voltage corresponding to the output current is calculated based on the output digital signal; the present application can test the digital signals corresponding to the two currents and calculate the correction values. During the correction process, the correction chip can be corrected by considering factors such as temperature and service life, and the corrected output voltage can be closer to the ideal voltage value corresponding to the input current. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 A flow chart of a voltage correction method provided by an embodiment of the present invention;
[0026] Figure 2 A circuit diagram of a correction chip provided by an embodiment of the present invention;
[0027] Figure 3 A flow chart of another voltage correction method provided by an embodiment of the present invention;
[0028] Figure 4 A flow chart of another voltage correction method provided by an embodiment of the present invention;
[0029] Figure 5 A schematic diagram of the structure of a voltage correction device provided by an embodiment of the present invention;
[0030] Figure 6 A schematic structural diagram of another voltage correction device provided by an embodiment of the present invention;
[0031] Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0033] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] Considering that the existing sensing technology generally converts current into voltage, and then converts it into a digital signal through an ADC (Analog to Digital Converter), and transmits it to a subsequent controller to manipulate and process the detection data output by the ADC. In actual applications, in order to handle a wide range of current changes, a logarithmic amplifier is used as a current-to-voltage conversion circuit. However, since the actual logarithmic amplifier is interfered by non-ideal factors such as noise and offset, and the sensor is also interfered by non-ideal factors such as input resistance, the output voltage of the logarithmic operational amplifier deviates from the ideal logarithmic curve, which affects the accuracy of the output voltage. In this regard, the embodiments of the invention provide a voltage correction method, device and electronic device, which can eliminate the interference of the above-mentioned non-ideal factors and make the corrected voltage closer to the ideal output voltage.
[0035] This embodiment provides a voltage correction method, which is applied to a correction chip, wherein the correction chip includes a logarithmic amplifier, and a current input module and an analog-to-digital converter connected to the logarithmic amplifier; Figure 1 A flow chart of a voltage correction method is shown. Figure 1 As shown, the above method comprises the following steps:
[0036] Step S102, inputting the first correction current into the logarithmic amplifier to obtain a first correction voltage, and inputting the second correction current into the logarithmic amplifier to obtain a second correction voltage;
[0037] In actual application, in order to calibrate the correction chip, after the chip is returned, the switch between the current input module and the logarithmic amplifier can be disconnected, and two currents with different current values can be connected to the logarithmic amplifier in sequence. These are the correction currents for the correction process of the correction chip. After the two correction currents pass through the logarithmic amplifier, the correction voltages corresponding to the two currents can be obtained respectively.
[0038] Step S104, inputting the first correction voltage into the analog-to-digital converter to obtain a first correction digital signal, and inputting the second correction voltage into the analog-to-digital converter to obtain a second correction digital signal;
[0039] The analog-to-digital converter used in this application is an ADC, i.e., an A / D converter, which is an electronic component that can convert analog signals into digital signals. A common analog-to-digital converter converts an input voltage signal into an output digital signal. Since the digital signal itself has no practical meaning, it only represents a relative size. Therefore, any analog-to-digital converter requires a reference analog quantity as a conversion standard. The more common reference standard is the maximum convertible signal size, and the output digital quantity represents the size of the input signal relative to the reference signal.
[0040] In practical applications, the digital signal obtained in the present application can be specifically obtained based on the reference voltage of the logarithmic amplifier, the number of bits of the ADC and the reference level. Taking a 16-bit ADC as an example, the first correction voltage is input into the analog-to-digital converter to obtain a first correction digital signal, wherein the corresponding relationship between the first correction voltage and the first correction digital signal can be shown as formula (1):
[0041]
[0042] Wherein, V1 is the first correction voltage, ambout1 is the first correction digital signal, and AVDD is the reference level of the 16-bit ADC. Similarly, the corresponding relationship between the second correction voltage and the second correction digital signal can also be obtained by formula (1), which will not be described in detail here.
[0043] Step S106, calculating a correction value based on the first correction digital signal and the second correction digital signal;
[0044] In actual applications, when a logarithmic amplifier is used as a current-to-voltage conversion circuit, the actual logarithmic amplifier may be interfered by non-ideal factors such as noise and offset, and the step-down element may also be interfered by non-ideal factors such as input resistance. Therefore, the first correction digital signal and the second correction digital signal are not the ideal currents corresponding to the first correction current and the second correction current. Therefore, the relationship between the first correction digital signal and the first correction current and the relationship between the second correction digital signal and the second correction current can be obtained respectively according to the ideal equation of the logarithmic amplifier of the present application, and the correction value can be solved according to the two relationship equations.
[0045] Step S108, the output current of the current input module is respectively passed through a logarithmic amplifier and an analog-to-digital converter to obtain an output digital signal corresponding to the output current;
[0046] After the correction chip performs the correction process, the correction current can be disconnected, the switch between the current input module and the logarithmic amplifier can be closed, the output current of the current input module can be connected to the logarithmic amplifier, and the output digital signal corresponding to the output current can be obtained according to the ideal equation of the logarithmic amplifier;
[0047] Step S110, using the correction value to correct the corresponding relationship between the output digital signal and the output current;
[0048] In practical applications, the correction value obtained above can be brought into the ideal equation of the logarithmic amplifier to obtain the corrected equation of the logarithmic amplifier, that is, the corresponding relationship between the corrected output digital signal and the output current.
[0049] Step S112, calculating and obtaining an output digital signal according to the corresponding relationship between the corrected output digital signal and the output current;
[0050] In practical applications, by substituting the output digital signal into the corrected equation of the logarithmic amplifier, a corrected digital signal close to the ideal digital signal corresponding to the output current can be obtained.
[0051] Step S114, calculating and obtaining an output voltage corresponding to the output current according to the obtained output digital signal.
[0052] A voltage correction method provided by an embodiment of the present invention can respectively connect two correction currents to a logarithmic amplifier to obtain two corresponding correction voltages, input the two correction voltages into an analog-to-digital converter to obtain two corresponding correction digital signals, calculate a correction value based on the two correction signals, use the correction value to correct the correspondence between the output digital and the output current, calculate the output digital signal based on the corrected correspondence, and calculate the output voltage corresponding to the output current based on the output digital signal; a corrected output voltage close to the ideal output voltage corresponding to the output current can be obtained.
[0053] This embodiment provides another voltage correction method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation method of the corresponding relationship between the correction digital signal changing with temperature and the correction current. Figure 2 The circuit diagram of a correction chip shown in FIG. 1 shows a logarithmic amplifier including a first voltage-reducing element VD1, a second voltage-reducing element VD2 and a comparator. The negative input terminal of the comparator is connected to the current input module 201, and the positive input terminal of the comparator is connected to the reference voltage Vref The anode of the first voltage-dropping element VD1 is connected to the negative input terminal of the comparator, the cathode of the first voltage-dropping element VD1 is connected to the output terminal of the comparator, the cathode of the second voltage-dropping element VD2 is connected to the output terminal of the comparator, and the anode of the second voltage-dropping element VD2 is connected to the reference current I ref and output voltage V out The positive input terminal of the comparator is also connected to the external node voltage source V inc Connection, where Figure 2 In the circuit diagram shown, a diode is used as the above-mentioned voltage-reducing element. In practical applications, other elements that can achieve the same effect, such as a transistor, etc., may also be used, and no specific limitation is made here. Figure 3 A flow chart showing another method of voltage correction is shown in FIG. Figure 3 As shown, the method comprises the following steps:
[0054] Step S302, inputting the first correction current into the logarithmic amplifier to obtain a first correction voltage, and inputting the second correction current into the logarithmic amplifier to obtain a second correction voltage;
[0055] Specifically, when current passes through the above-mentioned voltage-reducing element, there will be a certain voltage drop across the voltage-reducing element. The voltage formula across the first voltage-reducing element VD1 can be expressed as formula (2):
[0056] V ref +V inc -V VD1 =V T ln(I in / I S ) (2)
[0057] The voltage across the second voltage-dropping element VD2 can be expressed as follows:
[0058] V out -V VD1 =V T ln(I ref / I S ) (3)
[0059] Combining formula (2) and formula (3) we can get the following formula (4):
[0060] V out =V ref +V inc +V T ln(I ref / I in ) (4)
[0061] Among them, V ref Reference voltage, V incis the node voltage, V T is the thermal voltage due to the temperature difference between two points, I ref is the reference current, I S is the saturation current of the voltage-dropping element, I in is the current input to the negative terminal of the comparator, V out is the output voltage.
[0062] In this step, the negative input terminal of the comparator is connected to the correction current I X , the output voltage is the above correction current, so the first correction voltage and the second correction voltage are obtained by the following formula:
[0063] V X =V ref +V inc +V T ln(I ref / I X ) (5)
[0064] Among them, V X is the correction voltage corresponding to the correction current, V ref is the reference voltage, V inc is the node voltage, V T is the thermal voltage due to the temperature difference between two points, I ref is the reference current, I X To correct the current.
[0065] Substituting the first correction current and the second correction current into formula (5) respectively, the first correction voltage and the second correction voltage can be obtained.
[0066] V T is the thermal voltage due to the temperature difference between two points, which is proportional to the temperature. When the temperature is 300 Kelvin, V T The voltage is about 25.85mV.
[0067] Step S304, obtaining a first corrected digital signal and a second corrected digital signal according to the corresponding relationship between the first corrected voltage and the second corrected voltage and the number of bits of the input analog-to-digital converter, the reference level, and the first corrected digital signal and the second corrected digital signal;
[0068] Specifically, the output voltage is input into the ADC to generate a digital signal, which is set as ambout. The reference level of the ADC is set as AVDD, then V ref Can be set to The following equation is the corresponding relationship between the output voltage and the number of bits of the input analog-to-digital converter, the reference level, and the output digital signal, which can be expressed as formula (6):
[0069] Vout =ambout / 2 N×AVDD (6)
[0070] In this step, the correction voltage V X Substituting the corrected digital signal amboutx into formula (6), the corresponding relationship between the positive voltage and the number of bits of the input analog-to-digital converter, the reference level and the corrected digital signal can be obtained, which can be expressed as formula (7):
[0071] V X =amboutx / 2 N×AVDD (7)
[0072] Wherein, amboutx is the calibration signal, N is the number of bits of the analog-to-digital converter, and AVDD is the reference level of the analog-to-digital converter.
[0073] Substituting the first correction voltage and the second correction voltage into formula (7) respectively, the first correction digital signal and the second correction digital signal can be obtained.
[0074] Taking the first correction voltage in a 16-bit ADC and the first correction digital signal as an example, it can be expressed as the following relationship:
[0075] V1=ambout1 / 2 16×AVDD
[0076] Step S306, inputting the first corrected digital signal into the first output model to obtain a first relational expression about the correction value, and inputting the second corrected digital signal into the first output model to obtain a second relational expression about the correction value;
[0077] Specifically, by combining formulas (4) and (6), we can obtain formula (8):
[0078] V ref +V inc +V T ln(I ref / I in ) = ambout / 2 N×AVDD (8)
[0079] In practical applications, formula (8) can be further transformed to obtain formula (9):
[0080]
[0081] The above formula (9) can be used as the ideal equation of the logarithmic amplifier of the present application, and the correction signal amboutx and the correction current I X Substituting it into the above ideal equation, it can be regarded as the first output model.
[0082] The first output model is used to characterize the corresponding relationship between the change of the correction digital signal with temperature and the correction current;
[0083] The following is the first output model:
[0084]
[0085] Among them, T c is the temperature coefficient of the reference current when the temperature changes, ΔT is the temperature change, T is the current temperature value, and a and β are both correction values;
[0086] Here, taking a 16-bit ADC as an example, the first correction current, the first correction digital signal, the second correction current, and the second correction digital signal are respectively substituted into the above-mentioned first output model to obtain the first relationship (11) and the second relationship (12) about the correction value.
[0087]
[0088]
[0089] Step S308, solving the first relational expression and the second relational expression together to obtain a correction value;
[0090] Specifically, combining (11) and (12) yields:
[0091]
[0092]
[0093] α, β are the correction values of the logarithmic op amp transfer equation. When the temperature changes, that is, ΔT is not 0, the β formula can also be calculated. becomes ln(I1(1+I ref T c ΔT)), T is the current temperature value, which is provided by the temperature sensor inside the calibration chip.
[0094] Step S310, the output current of the current input module is respectively passed through a logarithmic amplifier and an analog-to-digital converter to obtain an output digital signal corresponding to the output current;
[0095] Step S312, using the correction value to correct the corresponding relationship between the output digital signal and the output current;
[0096] Step S314, calculating and obtaining an output digital signal according to the corresponding relationship between the corrected output digital signal and the output current;
[0097] Step S316, calculating and obtaining the output voltage corresponding to the output current according to the obtained output digital signal.
[0098] This embodiment provides another voltage correction method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation of the reference current correction method. Figure 4 A flow chart showing another method of voltage correction is shown in FIG. Figure 4 As shown, the current input module pre-stores a current conversion efficiency table, which stores a proportional coefficient between the output current output by the current input module at different temperatures and the output current output at a standard temperature; based on the steps of obtaining an output digital signal corresponding to the output current by passing the output current of the current input module through a logarithmic amplifier and an analog-to-digital converter, the method further includes:
[0099] Step S402, inputting the first correction current into the logarithmic amplifier to obtain a first correction voltage, and inputting the second correction current into the logarithmic amplifier to obtain a second correction voltage;
[0100] Step S404, inputting the first correction voltage into the analog-to-digital converter to obtain a first correction digital signal, and inputting the second correction voltage into the analog-to-digital converter to obtain a second correction digital signal;
[0101] Step S406, calculating a correction value based on the first correction digital signal and the second correction digital signal;
[0102] Step S408, obtaining a proportionality coefficient between the output current output by the current input module at different temperatures and the output current output at a standard temperature;
[0103] Step S410, obtaining the output current at the current temperature based on the output current output at the standard temperature;
[0104] Step S412, the output current of the current input module is respectively passed through a logarithmic amplifier and an analog-to-digital converter to obtain an output digital signal corresponding to the output current.
[0105] Here, a correction chip for ambient light detection is taken as an example, in which the current input module is mainly implemented by a photodiode. The above embodiment only considers the correction of non-ideal factors inside the chip. In fact, the ability of a photodiode to convert light energy into current will change significantly with changes in temperature and device life. Considering the change in conversion efficiency caused by the temperature or device life of the photodiode, the correction formula of formula (9) can be further deepened.
[0106] Here, temperature is used as an example. Assume that in actual applications, different temperatures and the same light have different input currents, as shown in formula (13):
[0107] I inT =coeefi I in25 (13)
[0108] Substituting formula (13) into formula (9), the software engineer can find the corresponding graph of light and current conversion capability described in the product manual of the corresponding photodiode, find the corresponding coeefi value, and make further corrections to the input current.
[0109] Step S414, using the correction value to correct the corresponding relationship between the output digital signal and the output current;
[0110] Step S416, calculating and obtaining an output digital signal according to the corresponding relationship between the corrected output digital signal and the output current;
[0111] Step S418, calculating and obtaining the output voltage corresponding to the output current according to the obtained output digital signal.
[0112] This embodiment provides another voltage correction method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing a specific implementation method of the reference current correction method by hardware, the correction chip also includes a reference current generation module, the reference current generation module is connected to the anode of the second voltage-reducing element, and is used to generate a reference current, the method includes:
[0113] A reference current is generated at different temperatures to match a proportionality coefficient of the output current at different temperatures to the output current at a standard temperature.
[0114] In practical applications, the change in conversion efficiency of the photodiode due to temperature or device life can be corrected from the inside of the correction chip or from the hardware perspective. A reference current is generated through a hardware circuit so that the temperature variation coefficient of the reference current is the same as the temperature variation coefficient of the input current. By adjusting the negative temperature coefficient of the resistor, different weights can be set with positive temperature coefficient resistors and negative temperature coefficient resistors, thereby generating a reference current that fits the proportional coefficient of the output current at different temperatures to the output current at the standard temperature.
[0115] Corresponding to the above method embodiment, an embodiment of the present invention provides a voltage correction device, Figure 5 A schematic diagram of the structure of a voltage correction device is shown, Figure 5 As shown, the device is applied to a correction chip, which includes a logarithmic amplifier, a current input module and an analog-to-digital converter connected to the logarithmic amplifier; the device includes:
[0116] A current input module 501, used for inputting a first correction current into a logarithmic amplifier to obtain a first correction voltage, and inputting a second correction current into the logarithmic amplifier to obtain a second correction voltage;
[0117] The analog-to-digital converter 502 is used to input the first correction voltage into the analog-to-digital converter to obtain a first correction digital signal, and input the second correction voltage into the analog-to-digital converter to obtain a second correction digital signal;
[0118] A calculation module 503, configured to calculate a correction value based on the first correction digital signal and the second correction digital signal;
[0119] The analog-to-digital converter 502 is also used to obtain an output digital signal corresponding to the output current by passing the output current of the current input module through the logarithmic amplifier and the analog-to-digital converter;
[0120] A correction module 504, used to correct the corresponding relationship between the output digital signal and the output current using the correction value;
[0121] The calculation module 503 is further used to calculate the output digital signal according to the corresponding relationship between the corrected output digital signal and the output current;
[0122] The calculation module 503 is further used to calculate the output voltage corresponding to the output current according to the obtained output digital signal.
[0123] exist Figure 5 On the basis of Figure 6 A schematic diagram of the structure of another voltage correction device is shown, wherein the analog-to-digital converter is further used to obtain a first corrected digital signal and a second corrected digital signal according to the corresponding relationship between the first corrected voltage and the second corrected voltage and the number of bits input to the analog-to-digital converter, the reference level, and the first corrected digital signal and the second corrected digital signal;
[0124] The calculation module 503 is further used to input the first correction digital signal into the first output model to obtain a first relationship about the correction value, and input the second correction digital signal into the first output model to obtain a second relationship about the correction value; wherein the first output model is used to characterize the corresponding relationship between the change of the correction digital signal with temperature and the correction current;
[0125] The current input module 501 is further used for obtaining an output digital signal corresponding to the output current based on the output current of the current input module passing through a logarithmic amplifier and an analog-to-digital converter, including:
[0126] Obtaining a proportionality coefficient between the output current output by the current input module at different temperatures and the output current output at the standard temperature;
[0127] The output current at the current temperature is obtained based on the output current at the standard temperature;
[0128] The output current of the current input module is respectively passed through a logarithmic amplifier and an analog-to-digital converter to obtain an output digital signal corresponding to the output current;
[0129] The reference current generating module 601 is used to generate, at different temperatures, reference currents that fit the proportionality coefficients of the output currents at different temperatures and the output currents at the standard temperature.
[0130] Further, Figure 7 The electronic device shown further includes a bus 72 and a communication interface 73 , and the processor 70 , the communication interface 73 and the memory 71 are connected via the bus 72 .
[0131] Among them, the memory 71 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 73 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 72 can be an ISA (Industrial Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Enhanced Industry Standard Architecture) bus, etc. The above-mentioned bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0132] The processor 70 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 70. The above processor 70 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can 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 gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 71, and the processor 70 reads the information in the memory 71 and completes the steps of the method of the aforementioned embodiment in combination with its hardware. The embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the aforementioned method.
[0133] The voltage correction method, device and computer program product of the electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.
[0134] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0135] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0136] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0137] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0138] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A voltage correction method, characterized in that: The method is applied to a correction chip, which includes a logarithmic amplifier, a current input module and an analog-to-digital converter connected to the logarithmic amplifier; the method includes: Inputting a first correction current into the logarithmic amplifier to obtain a first correction voltage, and inputting a second correction current into the logarithmic amplifier to obtain a second correction voltage; Inputting the first correction voltage into the analog-to-digital converter to obtain a first correction digital signal, and inputting the second correction voltage into the analog-to-digital converter to obtain a second correction digital signal; calculating a correction value based on the first corrected digital signal and the second corrected digital signal; The output current of the current input module is respectively passed through the logarithmic amplifier and the analog-to-digital converter to obtain an output digital signal corresponding to the output current; Correcting the corresponding relationship between the output digital signal and the output current using the correction value; The output digital signal is obtained by calculation according to the corresponding relationship between the corrected output digital signal and the output current; Calculate the output voltage corresponding to the output current according to the obtained output digital signal; The step of calculating the correction value based on the first correction digital signal and the second correction digital signal includes: Inputting the first corrected digital signal into a first output model to obtain a first relational expression about a correction value, and inputting the second corrected digital signal into the first output model to obtain a second relational expression about a correction value; wherein the first output model is used to characterize the corresponding relationship between the change of the corrected digital signal with temperature and the correction current; The following is the first output model: Solving the first relational expression and the second relational expression together to obtain a correction value; Among them, I ref is the reference current, T c is the temperature coefficient of the reference current changing with temperature when the temperature changes, ΔT is the temperature change, T is the current temperature value, α and β are both the correction values, amboutx is the correction signal, N is the number of bits of the analog-to-digital converter, and I X To correct the current.
2. The method according to claim 1, characterized in that The logarithmic amplifier includes a first buck element, a second buck element and a comparator, wherein the negative input terminal of the comparator is connected to the current input module, the positive input terminal of the comparator is connected to a reference voltage, the anode of the first buck element is connected to the negative input terminal of the comparator, the cathode of the first buck element is connected to the output terminal of the comparator, the cathode of the second buck element is connected to the output terminal of the comparator, the anode of the second buck element is connected to the reference current and output voltage terminal, and the positive input terminal of the comparator is also connected to an external node voltage source; The first correction voltage and the second correction voltage are obtained by the following formula: V X =V ref +V inc +V T ln(I ref / I X ) Among them, V X is the correction voltage corresponding to the correction current, V ref is the reference voltage, V inc is the node voltage, V T is the thermal voltage due to the temperature difference between two points, I ref is the reference current, I X To correct the current.
3. The method according to claim 1, characterized in that The steps of inputting the first correction voltage into the analog-to-digital converter to obtain a first correction digital signal, and inputting the second correction voltage into the analog-to-digital converter to obtain a second correction digital signal include: Obtaining a first corrected digital signal and a second corrected digital signal according to a correspondence between the first corrected voltage and the second corrected voltage, the number of bits of the analog-to-digital converter, a reference level, and the first corrected digital signal and the second corrected digital signal; The following equation is the corresponding relationship between the correction voltage and the number of bits of the analog-to-digital converter, the reference level, and the correction digital signal: V X =aboutx / 2 N×AVDD Wherein, amboutx is a calibration signal, N is the number of bits of the analog-to-digital converter, and AVDD is a reference level of the analog-to-digital converter.
4. The method according to claim 1, characterized in that: The current input module pre-stores a current conversion efficiency table, wherein the current conversion efficiency table stores a proportional coefficient between the output current output by the current input module at different temperatures and the output current output at a standard temperature; The steps of obtaining an output digital signal corresponding to the output current by passing the output current of the current input module through the logarithmic amplifier and the analog-to-digital converter respectively include: Obtaining a proportionality coefficient between the output current output by the current input module at different temperatures and the output current output at a standard temperature; Obtaining the output current at the current temperature based on the output current output at the standard temperature; The output current of the current input module is respectively passed through the logarithmic amplifier and the analog-to-digital converter to obtain an output digital signal corresponding to the output current.
5. The method according to claim 2, characterized in that: The correction chip further includes a reference current generating module, the reference current generating module is connected to the anode of the second voltage-reducing element and is used to generate the reference current. The method includes: The reference current is generated to fit the proportionality coefficient of the output current at different temperatures to the output current at a standard temperature.
6. A voltage correction device, characterized in that: The device is applied to a correction chip, the correction chip comprises a logarithmic amplifier, and a current input module and an analog-to-digital converter connected to the logarithmic amplifier; the device comprises: A current input module, used for inputting a first correction current into the logarithmic amplifier to obtain a first correction voltage, and inputting a second correction current into the logarithmic amplifier to obtain a second correction voltage; an analog-to-digital converter, configured to input the first correction voltage into the analog-to-digital converter to obtain a first correction digital signal, and input the second correction voltage into the analog-to-digital converter to obtain a second correction digital signal; A calculation module, configured to calculate a correction value based on the first correction digital signal and the second correction digital signal; The analog-to-digital converter is further used to obtain an output digital signal corresponding to the output current by respectively passing the output current of the current input module through the logarithmic amplifier and the analog-to-digital converter; A correction module, used to correct the corresponding relationship between the output digital signal and the output current using the correction value; The calculation module is further used to calculate the output digital signal according to the corresponding relationship between the corrected output digital signal and the output current; The calculation module is further used to calculate the output voltage corresponding to the output current according to the obtained output digital signal; The calculation module is further used to input the first correction digital signal into the first output model to obtain a first relationship about the correction value, and input the second correction digital signal into the first output model to obtain a second relationship about the correction value; wherein the first output model is used to characterize the corresponding relationship between the change of the correction digital signal with temperature and the correction current; The following is the first output model: Solving the first relational expression and the second relational expression together to obtain a correction value; Among them, I ref is the reference current, T c is the temperature coefficient of the reference current changing with temperature when the temperature changes, ΔT is the temperature change, T is the current temperature value, α and β are both the correction values, amboutx is the correction signal, N is the number of bits of the analog-to-digital converter, and I X To correct the current.
7. The device according to claim 6, characterized in that The device also includes: The analog-to-digital converter is further used to obtain a first corrected digital signal and a second corrected digital signal according to the first corrected voltage and the second corrected voltage, the number of bits of the analog-to-digital converter, the reference level, and the corresponding relationship between the first corrected digital signal and the second corrected digital signal; The calculation module is further used to input the first correction digital signal into the first output model to obtain a first relationship about the correction value, and input the second correction digital signal into the first output model to obtain a second relationship about the correction value; wherein the first output model is used to characterize the corresponding relationship between the change of the correction digital signal with temperature and the correction current; The current input module is further used for obtaining an output digital signal corresponding to the output current based on the output current of the current input module passing through the logarithmic amplifier and the analog-to-digital converter, including: Obtaining a proportionality coefficient between the output current output by the current input module at different temperatures and the output current output at a standard temperature; Obtaining the output current at the current temperature based on the output current output at the standard temperature; The output current of the current input module is respectively passed through the logarithmic amplifier and the analog-to-digital converter to obtain an output digital signal corresponding to the output current; The reference current generating module is used to generate the reference current at different temperatures that matches the proportionality coefficient of the output current at different temperatures to the output current at the standard temperature.
8. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data acquisition equipment with self-calibration function
CN213094182U
Logarithmic amplifier with temperature compensation means
US3992622A