Secondary calibration method of electronic equipment and electronic equipment

By adopting the secondary calibration method in electronic equipment and updating the proportional coefficient and bias constant, the existing calibration method solves the problem that the equipment cannot work completely and the accuracy is not high, achieves high-precision calibration, and reduces costs and computing resources. consumption.

CN117526939BActive Publication Date: 2024-08-27HUNAN ENZHI PRECISION ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311384823.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-24
Publication Date
2024-08-27
Estimated Expiration
2043-10-24

AI Technical Summary

Technical Problem

Existing electronic equipment calibration methods have problems such as the equipment being unable to work completely, the calibration procedures being highly complex, low accuracy, and additional filtering costs.

Method used

The secondary calibration method is used to obtain the hardware circuit parameters of the sampling circuit and ADC module, calculate the initial proportional coefficient and bias constant, and measure multiple points through external voltage acquisition equipment to update these parameters, reducing the need for filtering of digital quantities.

Benefits of technology

The accuracy of calibration is improved, costs and computing resources are saved, additional filtering steps are avoided, and the working accuracy of electronic equipment is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117526939B
    Figure CN117526939B
Patent Text Reader

Abstract

The present invention discloses a secondary calibration method of an electronic device and the electronic device, comprising the following steps: calculating an initial proportional coefficient and an initial bias constant according to hardware circuit parameters; inputting a voltage at a sampling end of a sampling circuit, measuring the voltage at the first sampling end of the sampling circuit by an external voltage acquisition device, and reading a first measurement value output by a current ADC module; changing the magnitude of the input voltage at the sampling end of the sampling circuit, measuring the voltage at the second sampling end of the sampling circuit again by an external voltage acquisition device, and reading a second measurement value output by the current ADC module; calculating the updated proportional coefficient and the initial bias constant by a secondary calibration formula; and finally performing sampling calculation of the electronic device. The present invention does not need to use digital quantities, so there is no need to perform additional filtering on the digital quantities, which can save costs and computing resource consumption, and performs secondary calibration, which can improve the accuracy of calibration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of sampling, and in particular to a secondary calibration method of an electronic device and the electronic device. Background Art

[0002] Electronic devices usually have sampling circuits, which convert analog quantities into digital quantities for reading and display. There is a certain correspondence between the digital quantity and the analog quantity. It is through this correspondence that the size of the analog quantity can be reversely calculated from the digital quantity. In most applications, the correspondence between digital quantity and analog quantity is linear, which can be expressed by the formula y=kx+b, where x is the digital quantity, y is the analog quantity, k is the proportionality coefficient, and b is the bias constant. Therefore, as long as the proportionality coefficient k and the bias constant b are obtained, the correspondence between the digital quantity x and the analog quantity y can be determined and calculated.

[0003] Therefore, it is crucial to determine the proportional coefficient k and bias constant b of the electronic device. According to the two-point principle, k and b can be calculated in reverse through the two points (x1, y1) and (x2, y2). In the formula, x1 and y1 are the digital and analog quantities of the first sampling point, and x2 and y2 are the digital and analog quantities of the second sampling point. After k and b are calculated, the corresponding analog quantity can be calculated for any digital quantity. Obtaining the value of the proportional coefficient k and the bias constant b is called calibration. The existing calibration method is to directly read the digital quantity through the electronic device, and then measure the analog quantity through a third-party device, and calculate the proportional coefficient k and the bias constant b based on the values ​​of the analog and digital quantities twice.

[0004] There are two disadvantages in the existing calibration method. The first is that before calibration, because k and b are to be determined, the electronic device cannot work completely, and the digital quantity read is very inaccurate. The second is that the calibration procedure is relatively complex. Due to the objective existence of unfavorable factors such as sampling interference, quantization error, harmonics, ripples, etc., even if the analog quantity remains constant, the digital quantity converted by the sampling circuit is also jumping. Therefore, if the digital quantity needs to be used, it is necessary to smooth the digital quantity to reduce the impact of the digital quantity jumping. This additional and newly added filtering is only useful during calibration and does not work during normal work, thus increasing additional costs and computing resources. In addition, the calibration of electronic equipment will be affected by the precision error of components, and the obtained proportional coefficient k and bias constant b have large errors, and there is a defect of low accuracy. Summary of the invention

[0005] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a secondary calibration method for an electronic device and an electronic device, which can solve the problem that the existing calibration method needs to add an additional digital quantity filtering unit in the electronic device, which increases additional costs and computing resources, and has high accuracy.

[0006] According to the secondary calibration method of the electronic device of the first aspect of the present invention, a sampling circuit and an ADC module are provided in the electronic device, and the ADC module converts the analog quantity collected by the sampling circuit into a digital quantity, comprising the following steps:

[0007] Obtain the hardware circuit parameters of the sampling circuit and ADC module, and calculate the initial proportional coefficient k based on the hardware circuit parameters 初 and the initial bias constant b 初 ;

[0008] Input a voltage at the sampling end of the sampling circuit, and measure the voltage y at the first sampling end of the sampling circuit through an external voltage acquisition device. 真1 , and read the first measurement value y output by the current ADC module 原1 ;

[0009] Change the input voltage of the sampling terminal of the sampling circuit, and measure the voltage y of the second sampling terminal of the sampling circuit again through the external voltage acquisition device. 真2 , and read the second measurement value y output by the current ADC module 原2 ;

[0010] Calculate the updated proportional coefficient k through the secondary calibration formula 新 and the initial bias constant b 新 , the secondary calibration formula is

[0011]

[0012] According to the updated proportional coefficient k 新 and the bias constant b 新 Perform sampling calculations for electronic devices.

[0013] The secondary calibration method of the electronic device according to the first aspect of the present invention has at least the following beneficial effects:

[0014] The embodiment of the present invention first obtains the hardware circuit parameters of the sampling circuit and the ADC module, and calculates the initial proportionality coefficient k according to the hardware circuit parameters. 初 and the initial bias constant b 初 ; Input a voltage at the sampling end of the sampling circuit, and measure the voltage y at the first sampling end of the sampling circuit through an external voltage acquisition device 真1 , and read the first measurement value y output by the current ADC module 原1 ; Change the size of the sampling terminal input voltage of the sampling circuit, and measure the second sampling terminal voltage y of the sampling circuit again through the external voltage acquisition device 真2 , and read the second measurement value y output by the current ADC module 原2; Calculate the updated proportional coefficient k through the secondary calibration formula 新 and the initial bias constant b 新 ; According to the updated proportional coefficient k 新 and the bias constant b 新 The present application adopts a secondary calibration method to accurately obtain the proportional coefficient k and the bias constant b, and then calculates the corresponding relationship between the digital quantity and the analog quantity according to the proportional coefficient k and the bias constant b, and does not need to use the digital quantity, so there is no need to perform additional filtering on the digital quantity, which can save costs and computing resource consumption, and performs secondary calibration to improve the accuracy of calibration.

[0015] According to some embodiments of the present invention, in the step of obtaining the hardware circuit parameters of the sampling circuit and the ADC module, the hardware circuit parameters of the sampling circuit and the ADC module include the resistance value of the voltage divider resistor of the sampling circuit, the reference voltage of the ADC module and the number of bits of the ADC module.

[0016] According to some embodiments of the present invention, the initial proportionality coefficient k is calculated according to the hardware circuit parameters. 初 and the initial bias constant b 初 The calculation formula is:

[0017]

[0018] b 初 =0

[0019] Wherein, R1 is the resistance value of the first voltage-dividing resistor of the sampling circuit, R2 is the resistance value of the second voltage-dividing resistor of the sampling circuit, Vref is the reference voltage value of the ADC module, and N is the number of bits of the ADC module.

[0020] According to some embodiments of the present invention, in the step of inputting a voltage to the sampling terminal of the sampling circuit, an excitation is input to the sampling terminal of the sampling circuit through an external excitation source.

[0021] According to some embodiments of the present invention, in the step of inputting a voltage to the sampling end of the sampling circuit, a voltage is input to the sampling end of the sampling circuit through an electronic device.

[0022] According to some embodiments of the present invention, the voltage y of the first sampling terminal of the sampling circuit is measured by an external voltage acquisition device. 真1 Step 1 and measuring the voltage y of the second sampling terminal of the sampling circuit again by an external voltage acquisition device 真2 In the steps, the external voltage acquisition device is a high-precision table meter or a high-precision multimeter.

[0023] According to some embodiments of the present invention, the voltage y of the first sampling terminal of the sampling circuit is measured by an external voltage acquisition device.真1 Step 1 and measuring the voltage y of the second sampling terminal of the sampling circuit again by an external voltage acquisition device 真2 In the step, the external voltage acquisition device is an external excitation source echo measurement unit.

[0024] The electronic device according to the second aspect of the present invention comprises a sampling circuit, an ADC module, and an MCU. The sampling circuit is connected to the ADC module to convert an analog quantity into a digital quantity. The memory is used to store an updated proportional coefficient k. 新 and the bias constant b 新 , the MCU is based on the proportionality coefficient k 新 and the bias constant b 新 Perform sampling calculations.

[0025] The electronic device according to the second aspect of the present invention has at least the following beneficial effects:

[0026] The embodiment of the present invention first obtains the hardware circuit parameters of the sampling circuit and the ADC module, and calculates the initial proportionality coefficient k according to the hardware circuit parameters. 初 and the initial bias constant b 初 ; Input a voltage at the sampling end of the sampling circuit, and measure the voltage y at the first sampling end of the sampling circuit through an external voltage acquisition device 真1 , and read the first measurement value y output by the current ADC module 原1 ; Change the size of the sampling terminal input voltage of the sampling circuit, and measure the second sampling terminal voltage y of the sampling circuit again through the external voltage acquisition device 真2 , and read the second measurement value y output by the current ADC module 原2 ; Calculate the updated proportional coefficient k through the secondary calibration formula 新 and the initial bias constant b 新 ; According to the updated proportional coefficient k 新 and the bias constant b 新 The present application adopts a secondary calibration method to accurately obtain the proportional coefficient k and the bias constant b, and then calculates the corresponding relationship between the digital quantity and the analog quantity according to the proportional coefficient k and the bias constant b, and does not need to use the digital quantity, so there is no need to perform additional filtering on the digital quantity, which can save costs and computing resource consumption, and performs secondary calibration to improve the accuracy of calibration.

[0027] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The present invention will be further described below with reference to the accompanying drawings and embodiments, wherein:

[0029] Figure 1 is a flow chart of a secondary calibration method for an electronic device in an embodiment of the present invention;

[0030] Figure 2 Schematic diagram of the sampling circuit. DETAILED DESCRIPTION

[0031] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0032] In the description of the present invention, it should be understood that descriptions involving orientation, such as orientation or positional relationship indicated as up, down, etc., 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 should not be understood as a limitation on the present invention.

[0033] In the description of the present invention, "a plurality" means more than two. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0034] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0035] Reference Figure 1 As shown, a secondary calibration method for an electronic device, it should be understood that the electronic device in this application refers to an electronic device with a sampling circuit, the electronic device is provided with a sampling circuit and an ADC module, the ADC module converts the analog quantity collected by the sampling circuit into a digital quantity, including the following steps:

[0036] S100, obtaining the hardware circuit parameters of the sampling circuit and the ADC module, and calculating the initial proportionality coefficient k according to the hardware circuit parameters 初 and the initial bias constant b 初 ;

[0037] Specifically, the hardware circuit parameters of the sampling circuit and the ADC module include the voltage divider resistance of the sampling circuit, the reference voltage of the ADC module and the number of bits of the ADC module. Figure 2The figure shows a schematic diagram of a standard sampling circuit, including voltage divider resistors R1 and R2. V1 is the sampled voltage, i.e., the voltage at the input of the sampling circuit, with a voltage range of 0-100V. The resistance values ​​of voltage divider resistors R1 and R2 are 950kΩ and 50kΩ, respectively. V2 is the voltage after voltage division, with a voltage range of 0-5V. Obviously, V2 is lower than V1. The voltage divider voltage V2 is connected to the ADC module, and V2 and V1 are in a linear relationship. The following formula exists:

[0038]

[0039] It should be understood that the digital value corresponding to the N-bit ADC module ranges from 0 to 2 N In this embodiment, the number of bits of the ADC module is 16 bits, so the digital value range of the ADC module is 0-65535, and the following formula exists:

[0040]

[0041] In the above formula, Dig is the digital value converted by the ADC module, Vref is the reference voltage of the ADC module, and N is the number of bits of the ADC.

[0042] Combining the above two formulas, we get:

[0043]

[0044] After inverse operation, we get:

[0045]

[0046] In the above formula, V1 is equivalent to y in y=kx+b, and Dig is equivalent to x in y=kx+b, so:

[0047]

[0048] b=0

[0049] The k and b in the above formula are the initial values ​​of k and b, so the initial proportionality coefficient k 初 and the initial bias constant b 初 The calculation formula is:

[0050]

[0051] b 初 =0.

[0052] S200, input a voltage to the sampling end of the sampling circuit, and measure the voltage y of the first sampling end of the sampling circuit through an external voltage acquisition device. 真1 , and read the first measurement value y output by the current ADC module原1 ;

[0053] It should be noted that the initial proportional coefficient k initial and the initial bias constant b initial obtained in step S100 are theoretically accurate and reliable, but because real components are not ideal components and there are errors in the device parameters, calibration is still required. In addition, in practical applications, when the use environment changes, such as aging, temperature, and humidity changes, the parameters of the components will change accordingly, so recalibration is also required during use. Whether it is calibration before the first use or calibration due to changes in the environment, it is called secondary calibration. It should be understood that secondary calibration is to make fine adjustments based on the primary calibration to improve the sampling accuracy.

[0054] It should be noted that in step S200, a voltage is input at the sampling end of the sampling circuit, and an excitation can be input to the sampling end V1 of the sampling circuit through an external excitation source; if the electronic device is a device that can output voltage, such as a DC power supply, then the electronic device can output a voltage, which is equivalent to inputting a voltage at the sampling end V1 of the sampling circuit through the electronic device.

[0055] It should be noted that in step S200, the external voltage acquisition device is a high-precision table or a high-precision multimeter. The voltage of the first sampling terminal of the sampling circuit is measured by the high-precision table or the high-precision multimeter, and the value obtained is regarded as the true value, which is recorded as y 真1 Of course, in addition to using a high-precision table or high-precision multimeter, if the external excitation source itself has an echo measurement function and its accuracy meets the requirements, the measured value of the excitation source itself can also be used as the true value.

[0056] It should be noted that in step S200, the first measurement value y output by the current ADC module is read. 原1 , refers to the measurement value directly read by the electronic device. The electronic device usually has an LCD display or a host computer available for use. The LCD screen or host computer can display the measurement value of the electronic device. This value is the electronic device converting the analog quantity into a digital quantity through the sampling circuit and ADC module, and then according to y 原1 =k 初 x1+b 初 It is calculated by the formula of . In the formula, x1 represents the digital value of the first calibration point.

[0057] S300, changing the magnitude of the input voltage at the sampling end of the sampling circuit, and measuring the voltage y at the second sampling end of the sampling circuit again through an external voltage acquisition device 真2 , and read the second measurement value y output by the current ADC module 原2 ;

[0058] It should be understood that changing the magnitude of the input voltage of the sampling terminal of the sampling circuit in step S300 refers to changing the magnitude of the excitation applied by the external excitation source, or changing the magnitude of the voltage output by the electronic device to be calibrated. Then, a high-precision table or multimeter is used to measure the voltage at V1 again, and the measured value is regarded as the true value, which is recorded as y 真2 Of course, if the excitation source itself has an echo measurement function and its accuracy meets the requirements, the measured value of the excitation source itself can also be used as the true value.

[0059] S400, calculating the updated proportionality coefficient k through the secondary calibration formula 新 and the initial bias constant b 新 , the secondary calibration formula is

[0060]

[0061] It should be understood that after the steps S100-S300, (y 真1 ,y 原1 ), (y 真2 ,y 原2 ) two calibration points. According to the coordinates of these two calibration points, the updated proportional coefficient k can be obtained according to the secondary calibration formula 新 and the initial bias constant b 新 , the specific calculation process is as follows:

[0062] The coordinates of the first calibration point are (y 真1 ,y 原1 ), so there is the following formula:

[0063] y 原1 =k 初 x1+b 初 (1)

[0064] y 真1 =k 新 x1+b 新 (2)

[0065] The coordinates of the second calibration point are (y 真2 ,y 原2 ), so there is the following formula:

[0066] y 原2 =k 初 x2+b 初 (3)

[0067] y 真2 =k 新 x2+b 新 (4)

[0068] According to formula (1) and (3), we can get:

[0069]

[0070] According to formula (2) and (4), we can get:

[0071]

[0072] Therefore, there exists:

[0073]

[0074] Then we get k 新 for:

[0075]

[0076] Furthermore, according to formula (2), we can get:

[0077] b 新 =y 真1 -k 新 x1

[0078] Substitute k 新 get:

[0079]

[0080] According to formula (1), we get:

[0081] k 初 x1=y 原1 -b 初

[0082] So we have:

[0083]

[0084] S500, according to the updated proportionality coefficient k 新 and the bias constant b 新 Perform sampling calculations for electronic devices.

[0085] Specifically, the updated proportional coefficient k is obtained 新 and the bias constant b 新 After that, the two new values ​​can be saved in EEPROM. Each time the electronic device is powered on, it reads from EEPROM and then follows the principle of "analog value = k 新 *Digital quantity+b 新 " is used for sampling calculation.

[0086] The embodiment of the present invention first obtains the hardware circuit parameters of the sampling circuit and the ADC module, and calculates the initial proportionality coefficient k according to the hardware circuit parameters. 初and the initial bias constant b 初 ; Input a voltage at the sampling end of the sampling circuit, and measure the voltage y at the first sampling end of the sampling circuit through an external voltage acquisition device 真1 , and read the first measurement value y output by the current ADC module 原1 ; Change the size of the sampling terminal input voltage of the sampling circuit, and measure the second sampling terminal voltage y of the sampling circuit again through the external voltage acquisition device 真2 , and read the second measurement value y output by the current ADC module 原2 ; Calculate the updated proportional coefficient k through the secondary calibration formula 新 and the initial bias constant b 新 ; According to the updated proportional coefficient k 新 and the bias constant b 新 The present application adopts a secondary calibration method to accurately obtain the proportional coefficient k and the bias constant b, and then calculates the corresponding relationship between the digital quantity and the analog quantity according to the proportional coefficient k and the bias constant b, and does not need to use the digital quantity, so there is no need to perform additional filtering on the digital quantity, which can save costs and computing resource consumption, and performs secondary calibration to improve the accuracy of calibration.

[0087] The present invention also relates to an electronic device for running the above-mentioned embodiment method, comprising a sampling circuit, an ADC module, and an MCU. The sampling circuit is connected to the ADC module to convert an analog quantity into a digital quantity, and a memory is used to store an updated proportional coefficient k. 新 and the bias constant b 新 MCU according to the proportional coefficient k 新 and the bias constant b 新 Perform sampling calculations.

[0088] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present invention.

Claims

1. A secondary calibration method for an electronic device, wherein a sampling circuit and an ADC module are provided in the electronic device, and the ADC module converts the analog quantity collected by the sampling circuit into a digital quantity. It is characterized in that The following steps are involved: Obtain the hardware circuit parameters of the sampling circuit and ADC module, and calculate the initial proportional coefficient k based on the hardware circuit parameters 初 and the initial bias constant b 初 ; Input a voltage at the sampling end of the sampling circuit, and measure the voltage y at the first sampling end of the sampling circuit through an external voltage acquisition device. 真1 , and read the first measurement value y output by the current ADC module 原1 ; Change the input voltage of the sampling terminal of the sampling circuit, and measure the voltage y of the second sampling terminal of the sampling circuit again through the external voltage acquisition device. 真2 , and read the second measurement value y output by the current ADC module 原2 ; Calculate the updated proportional coefficient k through the secondary calibration formula 新 and the initial bias constant b 新 , the secondary calibration formula is According to the updated proportional coefficient k 新 and the bias constant b 新 Perform sampling calculations for electronic devices.

2. The secondary calibration method of an electronic device according to claim 1, It is characterized in that In the step of obtaining the hardware circuit parameters of the sampling circuit and the ADC module, the hardware circuit parameters of the sampling circuit and the ADC module include the resistance value of the voltage divider resistor of the sampling circuit, the reference voltage of the ADC module and the number of bits of the ADC module.

3. The secondary calibration method of an electronic device according to claim 2, It is characterized in that The initial proportionality coefficient k is calculated according to the hardware circuit parameters. 初 and the initial bias constant b 初 The calculation formula is: b 初 =0 Wherein, R1 is the resistance value of the first voltage-dividing resistor of the sampling circuit, R2 is the resistance value of the second voltage-dividing resistor of the sampling circuit, Vref is the reference voltage value of the ADC module, and N is the number of bits of the ADC module.

4. The secondary calibration method of an electronic device according to claim 1, It is characterized in that In the step of inputting a voltage to the sampling end of the sampling circuit, an excitation is input to the sampling end of the sampling circuit through an external excitation source.

5. The secondary calibration method of an electronic device according to claim 1, It is characterized in that In the step of inputting a voltage to the sampling end of the sampling circuit, a voltage is input to the sampling end of the sampling circuit through an electronic device.

6. The secondary calibration method of an electronic device according to claim 1, It is characterized in that The voltage y of the first sampling terminal of the sampling circuit is measured by an external voltage acquisition device. 真1 Step 1 and measuring the voltage y of the second sampling terminal of the sampling circuit again by an external voltage acquisition device 真2 In the steps, the external voltage acquisition device is a high-precision table meter or a high-precision multimeter.

7. The secondary calibration method of an electronic device according to claim 1, It is characterized in that The voltage y of the first sampling terminal of the sampling circuit is measured by an external voltage acquisition device. 真1 Step 1 and measuring the voltage y of the second sampling terminal of the sampling circuit again by an external voltage acquisition device 真2 In the step, the external voltage acquisition device is an external excitation source echo measurement unit.

8. An electronic device for executing the method according to any one of claims 1 to 7, It is characterized in that The system comprises a sampling circuit, an ADC module, an MCU and a memory, wherein the sampling circuit is connected to the ADC module to convert the analog quantity into a digital quantity, and the memory is used to store the updated proportional coefficient k 新 and the bias constant b 新 , the MCU is based on the proportionality coefficient k 新 and the bias constant b 新 Perform sampling calculations.