A voltage detection method, circuit, device and storage medium

By using the temperature coefficient comparison table to correct the reference output voltage and formula parameters in voltage detection, the problems of low voltage detection accuracy and temperature drift error are solved, and high-precision voltage detection under low-cost conditions is achieved, especially at industrial-grade temperatures. Improved accuracy.

CN116243048BActive Publication Date: 2024-08-27GUANGZHOU ZHIYUAN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310008579.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-04
Publication Date
2024-08-27
Estimated Expiration
2043-01-04

AI Technical Summary

Technical Problem

Existing voltage detection methods have problems with low detection accuracy and temperature drift errors at industrial temperatures. Moreover, traditional methods are costly and difficult to achieve accuracy within 0.05%.

Method used

By detecting the ambient temperature, using the temperature coefficient comparison table to correct the reference output voltage value, correcting the parameters in the preset formula, voltage detection is realized, and voltage detection is performed through the corrected formula to reduce detection errors and temperature drift errors.

Benefits of technology

The accuracy of voltage detection is improved, the temperature drift error is reduced, and high-precision voltage detection is achieved under low-cost components, and the detection accuracy in the industrial temperature range is less than 0.05%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116243048B
    Figure CN116243048B
Patent Text Reader

Abstract

The embodiment of the present application discloses a voltage detection method, circuit, device and storage medium. The technical solution provided by the embodiment of the present application detects the ambient temperature. When the difference between the ambient temperature and the preset temperature value exceeds the preset threshold value, the reference output voltage value is corrected according to the temperature coefficient comparison table to obtain the first reference sampling voltage value and the first reference output voltage value; the parameters in the preset first formula are corrected according to the first reference sampling voltage value and the first reference output voltage value to obtain the second formula; the input voltage signal to be detected input by the user is received, the test sampling voltage value is output, and the test sampling voltage value and the second formula are calculated and processed to obtain the output voltage value of the corresponding input voltage signal to be detected, which can solve the problem of low voltage detection accuracy, reduce detection errors and temperature drift errors, and improve the accuracy of voltage detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of voltage detection technology, and in particular, to a voltage detection method, circuit, device and storage medium. Background Art

[0002] With the rapid development of the Internet of Things, various sensors have become an indispensable part of the Internet of Things, and the temperature application range of their corresponding signal processing systems is also approaching the industrial level. Existing sensors generally convert detection signals into voltage signals for processing, and most of them are applicable at room temperature. Therefore, under the industrial temperature range, the temperature drift error of electronic devices will hinder the conversion accuracy of the entire sensor system.

[0003] The existing voltage detection basically uses A / D digital-to-analog conversion circuits, and different application circuits are selected according to the application scenarios. However, no matter which application circuit is selected, test errors and temperature drift errors are inevitable. For example, the error caused by voltage signal attenuation and current shunt in the application circuit, the gain error caused by the ADC amplifier PGA, and the temperature drift error caused in the industrial temperature range (-40℃~85℃).

[0004] Traditional methods to improve voltage detection accuracy and reduce temperature drift errors mostly use high-precision or low-temperature drift electronic components, which are relatively expensive. Summary of the invention

[0005] The embodiments of the present application provide a voltage detection method, circuit, device and storage medium, which can solve the problem of low voltage detection accuracy of low-cost components, reduce detection errors and temperature drift errors, and improve the accuracy of voltage detection.

[0006] In a first aspect, an embodiment of the present application provides a voltage detection method, comprising:

[0007] Detecting the ambient temperature, when the difference between the ambient temperature and the preset temperature value exceeds a preset threshold, correcting the reference output voltage value according to the temperature coefficient comparison table to obtain a first reference sampling voltage value and a first reference output voltage value;

[0008] According to the first reference sampling voltage value and the first reference output voltage value, the parameters in the preset first formula are corrected to obtain a second formula;

[0009] An input voltage signal to be detected input by a user is received, a test sampling voltage value is output, and a calculation process is performed according to the test sampling voltage value and the second formula to obtain an output voltage value of the corresponding input voltage signal to be detected.

[0010] Furthermore, before detecting the ambient temperature, the method includes:

[0011] Receive at least two first input voltage signals input by a user, and obtain corresponding at least two first sampled voltage values, wherein the first input voltage signal is a voltage signal corresponding to the first input voltage value;

[0012] Obtaining an initial parameter and a corresponding preset temperature value according to the at least two first sampled voltage values ​​and the corresponding at least two first input voltage values ​​and a preset initial formula;

[0013] The parameters in the preset initial formula are replaced with the initial parameters to obtain the preset first formula, and the preset first formula is associated with the preset temperature value.

[0014] Further, after obtaining the preset first formula, the method further comprises:

[0015] Detecting and processing a preset reference input voltage signal to obtain a corresponding reference sampling voltage value;

[0016] The reference output voltage value corresponding to the reference input voltage signal is obtained by performing calculation processing according to a preset first formula and the reference sampling voltage value.

[0017] Further, the detecting of the ambient temperature, when the difference between the ambient temperature and the preset temperature value exceeds a preset threshold, correcting the reference output voltage value according to the temperature coefficient comparison table to obtain the first reference sampling voltage value and the first reference output voltage value, includes:

[0018] Detecting the ambient temperature, when the difference between the ambient temperature and the preset temperature value exceeds the preset threshold, obtaining the temperature correction coefficient according to the temperature coefficient comparison table;

[0019] Correcting the reference output voltage value according to the temperature correction coefficient to obtain a first reference output voltage value;

[0020] Detecting and processing a first reference voltage signal corresponding to the first reference output voltage value to obtain a corresponding first reference sampling voltage value;

[0021] The step of correcting the parameters in the preset first formula according to the first reference sampling voltage value and the first reference output voltage value to obtain the second formula includes:

[0022] Correcting the parameters in the preset first formula according to the first reference sampling voltage value and the first reference output voltage value to obtain corresponding correction parameters;

[0023] The initial parameters in the preset first formula are replaced by the modified parameters to obtain the second formula.

[0024] Furthermore, the detecting and processing of the preset reference input voltage signal to obtain the corresponding reference output voltage value includes:

[0025] Detect and process two preset reference input voltages and output two corresponding ADC code values;

[0026] The two ADC code values ​​are transcoded to obtain two corresponding reference sampling voltage values.

[0027] Furthermore, after receiving the input voltage signal to be detected input by the user and performing calculation processing according to the output test sample voltage value and the second formula to obtain the output voltage value of the corresponding input voltage signal to be detected, the method further comprises:

[0028] After completing the preset number of detections, the current reference output voltage value is used for detection processing to obtain the corresponding reference sampling voltage value;

[0029] Calculate and process the current reference output voltage value, the corresponding reference sampling voltage value and the preset initial formula to obtain the updated parameter;

[0030] The updated parameters are used to replace the parameters in the preset first formula to obtain an updated preset first formula.

[0031] Further, the first reference output voltage value includes a reference output voltage value Vc1 and a reference output voltage value Vg1, and the preset first formula is expressed as Y=kx+b, where Y represents the output voltage value, x represents the sampled voltage value, and k and b represent parameters of the formula;

[0032] The step of correcting the parameters in the preset first formula according to the first reference sampling voltage value and the first reference output voltage value to obtain the second formula includes:

[0033] The reference output voltage value Vc1 and the corresponding reference sampling voltage value X1 are combined with the preset first formula to obtain the formula Vc1=k1(X1)+b1, where the values ​​of k1 and b1 are unknown values;

[0034] The reference output voltage value Vg1 and the corresponding reference sampling voltage value X2 are combined with the preset first formula to obtain the formula Vg1=k1(X2)+b1, where the values ​​of k1 and b1 are unknown values;

[0035] Calculate and process according to the formula Vc1=k1(X1)+b1 and the formula Vg1=k1(X2)+b1 to obtain the values ​​of parameters k1 and b1;

[0036] According to the values ​​of the parameters k1 and b1 and the preset first formula, the second formula is obtained as Y=k1x+b1, where Y represents the output voltage value, x represents the sampled voltage value, k1 and b1 represent the parameters of the formula, and k1 and b1 are parameters with known values.

[0037] In a second aspect, an embodiment of the present application provides a voltage detection circuit for implementing the voltage testing method described in the first aspect, including a voltage signal input module, a signal acquisition and processing module, a reference voltage signal module, a signal detection chip module, a temperature detection circuit module and a switch module;

[0038] The voltage signal input module is connected to the first end and the second end of the switch module, and the voltage signal module is used to receive a voltage signal input by a user, wherein the voltage signal includes a first input voltage signal and an input voltage signal to be detected;

[0039] The third end and the fourth end of the switch module are connected to the reference voltage signal module, the fifth end and the sixth end of the switch module are connected to the input end of the signal acquisition module, the switch module is used to transmit the voltage signal received from the voltage signal input module and the reference voltage signal module to the signal acquisition processing module, and the reference voltage signal module is used to provide at least two reference input voltage signals;

[0040] The output end of the signal acquisition and processing module is connected to the first end of the signal detection chip module, and the signal acquisition and processing circuit module is used to perform attenuation and filtering processing on the voltage signal;

[0041] The second end of the signal detection chip module is connected to the temperature detection circuit module. The signal detection chip module is used to correct the circuit parameters according to the voltage signal received from the signal acquisition circuit module and the ambient temperature value received from the temperature detection circuit module, and calculate the input voltage value of the input voltage to be detected.

[0042] In a third aspect, an embodiment of the present application provides a voltage detection device, including:

[0043] memory and one or more processors;

[0044] The memory is used to store one or more programs;

[0045] When the one or more programs are executed by the one or more processors, the one or more processors implement the voltage detection method as described in the first aspect.

[0046] In a fourth aspect, an embodiment of the present application provides a storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the voltage detection method as described in the first aspect.

[0047] The embodiment of the present application detects the ambient temperature. When the difference between the ambient temperature and the preset temperature value exceeds the preset threshold value, the reference output voltage value is corrected according to the temperature coefficient comparison table to obtain the first reference sampling voltage value and the first reference output voltage value. The parameters in the preset first formula are corrected according to the first reference sampling voltage value and the first reference output voltage value to obtain the second formula, and the input voltage signal to be detected input by the user is received, and the test sampling voltage value is output. The test sampling voltage value and the second formula are calculated and processed to obtain the output voltage value of the corresponding input voltage signal to be tested. By adopting the above technical means, the reference output voltage value can be corrected by the temperature coefficient comparison table, and the preset first formula is corrected based on the corrected first reference output voltage and the corresponding first reference sampling voltage value to obtain the second formula, and voltage detection is performed based on the second formula, so as to avoid the problem of low voltage detection accuracy, reduce temperature drift error, and improve the accuracy of voltage detection. In addition, by correcting the reference voltage, the detection error is reduced, and the accuracy of voltage detection is further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a flow chart of a voltage detection method provided in an embodiment of the present application;

[0049] Figure 2 This is a schematic diagram of a temperature correction coefficient versus temperature curve provided in an embodiment of the present application;

[0050] Figure 3 This is a comparison chart of actual detection accuracy of a circuit at room temperature provided in an embodiment of the present application;

[0051] Figure 4 It is a table of measured temperature drift coefficients provided in an embodiment of the present application;

[0052] Figure 5 is a schematic diagram of a voltage detection circuit provided in an embodiment of the present application;

[0053] Figure 6 is another schematic diagram of a voltage detection circuit provided in an embodiment of the present application;

[0054] Figure 7 It is a structural schematic diagram of a voltage detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0056] The voltage detection method, circuit, device and storage medium provided in the present application are intended to correct the reference output voltage value through the temperature coefficient comparison table during voltage detection, and correct the preset first formula based on the corrected first reference output voltage and the corresponding first reference sampling voltage to obtain the second formula, and perform voltage detection based on the second formula, so as to reduce the detection error and reduce the temperature drift error, and improve the accuracy of voltage detection. Compared with the traditional voltage detection method, it usually produces detection error and temperature drift error, such as the error caused by attenuation and current shunting in the application circuit, the gain error generated by the ADC amplifier PGA, and the temperature drift error generated under the industrial temperature range (-40℃~85℃). Most of the traditional methods for improving the accuracy of voltage detection use high-precision and low-temperature drift electronic components, which are not only costly, but also difficult to achieve a detection accuracy of less than 0.05%. Based on this, a voltage detection method of an embodiment of the present application is provided to solve the problem of low detection accuracy in the existing voltage detection process.

[0057] Figure 1 A flow chart of a voltage detection method provided in an embodiment of the present application is given. The voltage detection method provided in this embodiment can be executed by a voltage detection device, and the voltage detection device can be implemented by software and / or hardware. The voltage detection device can be composed of two or more physical entities, or can be composed of one physical entity. Generally speaking, the voltage detection device can be a voltage detection device, such as a voltage test sensor, etc.

[0058] The following description is made by taking a voltage testing device as an example to implement the voltage detection method. Figure 1 , the voltage detection method specifically includes:

[0059] S101, detecting the ambient temperature, when the difference between the ambient temperature and the preset temperature value exceeds the preset threshold, correcting the reference output voltage value according to the temperature coefficient comparison table to obtain a first reference sampling voltage value and a first reference output voltage value.

[0060] Ambient temperature can be understood as the temperature of the environment in which the voltage detection device is located. In industrial scenarios, the industrial temperature range is -40℃~85℃. Within the industrial temperature range, the voltage detection device will produce corresponding temperature drift errors. In order to eliminate the temperature drift error, it is necessary to first determine the ambient temperature and corresponding circuit parameters at normal temperature.

[0061] At normal temperature, the voltage detection device receives at least two first input voltage signals input by the user, and the first input voltage signal is a voltage signal corresponding to the first input voltage value. The voltage detection device detects and processes the received first input voltage signal, and outputs the corresponding at least two first sampled voltage values. According to the at least two first sampled voltage values ​​and the corresponding at least two first input voltage values ​​and the preset initial formula, the initial parameters and the corresponding preset temperature value are obtained. The parameters in the preset initial formula are replaced with the initial parameters to obtain the preset first formula, and the preset first formula is associated with the preset temperature value. In the above, the corresponding preset temperature value at normal temperature and the preset first formula associated with the preset temperature value can be obtained, and the preset first formula is the parameter formula of the corresponding detection circuit. By obtaining the initial parameters, the detection error caused by the parameter deviation in the hardware circuit can be eliminated, thereby improving the accuracy and reliability of the voltage test.

[0062] Exemplarily, the preset initial formula is a linear function Y=kx+b, where Y represents the output voltage value or the input voltage value, x represents the sampled voltage value, and k and b represent the initial parameters. For the voltage detection device, the initial values ​​of k and b will be set when the program is burned, but based on factors such as the existence of detection errors, the set initial values ​​may not be accurate. Assuming that the set initial values ​​are k=1, b=0, it is generally considered that initial parameter calibration is required when k=1, b=0 is seen. Assuming that at room temperature of 25°C, the voltage detection device receives at least two first input voltage values ​​of known voltage values ​​input by the user, assuming that the user inputs two first input voltage values ​​of known voltage values, and the first input voltages of the two known voltage values ​​are voltage V1 and voltage V2, the voltage detection device performs voltage detection processing on voltage V1 and voltage V2, and correspondingly outputs two ADC code values, namely Code1 and Code2, and transcodes Code1 and Code2 to obtain corresponding two sampled voltages V10 and V20. Substitute the voltage V1 and voltage V2 corresponding to the first input voltage signal and the voltage V10 and V20 corresponding to the first sampled voltage signal into the preset initial formula to obtain the formula V1=kV10+b and the formula V2=kV20+b. According to the formula V1=kV10+b and the formula V2=kV20+b, mathematical operations can be performed to obtain the values ​​of k and b. Assuming that K=1.01 and b=0.05, the values ​​of k and b at this time are the initial parameters. Replace the parameters in the preset initial formula with the initial parameters to obtain the preset first formula, that is, the preset first formula is Y=1.010x+0.050, and the preset first formula is associated with the preset temperature value, that is, the preset temperature value is 25°C, and the corresponding associated formula is Y=1.01x+0.05. By obtaining the initial parameters, the detection error caused by parameter deviation in the hardware circuit can be eliminated, thereby improving the accuracy and reliability of the voltage test.

[0063] There are at least two reference output voltages in the voltage detection device, and the calibration and update of the parameters of the preset initial formula can be performed later according to the corresponding reference output voltage. When the voltage detection device burns the program, the initial reference output voltage value is usually different from the actual value, so it is necessary to calibrate the parameters of the preset initial formula by receiving at least two first input voltage signals input by the user, and the two first input voltage signals are precisely known voltage values, for example, the voltage signal output by a high-precision source meter is used as the first input voltage signal involved in the embodiment of the present application. After calibrating the initial parameters, it is also necessary to calibrate the reference output voltage to determine the actual value of the reference output voltage in the voltage detection device. The voltage detection device detects and processes the preset reference output voltage signal, outputs the corresponding ADC code value, and transcodes the ADC code value to obtain the corresponding reference sampling voltage value. According to the preset first formula and the reference sampling voltage value, calculation processing is performed to obtain the reference output voltage value corresponding to the reference output voltage signal.

[0064] It should be noted that the parameter "update" mentioned above is not a storage update or overwrite in the physical sense, but rather an assignment of variables during program execution. The initial parameters still exist after the circuit is powered on again.

[0065] Exemplarily, it is assumed that there are two reference output voltage values ​​in the voltage detection device, namely, the reference output voltage value Vc and the reference output voltage value Vg. When the voltage detection device is performing a burning program, the default values ​​of the reference output voltage value Vc and the reference output voltage value Vg are Vc=0V and Vg=2.5V. Due to factors such as hardware errors, the specific values ​​of the reference output voltage value Vc and the reference output voltage value Vg in the voltage detection device during the actual test are different from the default values. Therefore, it is necessary to perform a calibration process to obtain the specific values ​​of the reference output voltage value Vc and the reference output voltage value Vg. The control voltage detection device performs detection processing on the reference output voltage value Vc and the reference output voltage value Vg, and correspondingly outputs two ADC code values, namely, Code3 and Code4. Code3 and Code4 are transcoded to obtain reference sampling voltage value V30 and reference sampling voltage value V40. Based on the above, the preset first formula is Y=1.01x+0.005, and the reference sampling voltage value is used as the X value of the preset first formula, and the corresponding Y value is the corresponding reference output voltage value Vc. The reference sampling voltage value V40 is used as the X value of the preset first formula, and the corresponding Y value is the corresponding reference output voltage value Vg, so that the specific values ​​of the reference output voltage value Vc and the reference output voltage value Vg can be determined. The specific values ​​of the reference output voltage value Vc and the reference output voltage value Vg at this time are associated with the ambient temperature at this time. Assume that the specific value of the reference output voltage value Vc obtained by the above calculation is 0.01V, and the specific value of the reference output voltage value Vg is 2.52V.

[0066] It should be noted that the reference output voltage values ​​Vc and Vg calculated by the preset first formula are also initial values. When detecting the reference output voltage signal, the ambient temperature should be within the same temperature range as the above-mentioned first input voltage signal detection, or at the same time in a relative sense.

[0067] It should be noted that the values ​​of k, b, Vc and Vg are calibration values ​​at the current ambient temperature, and are not a set of constant values. They will change with changes in ambient temperature and usage scenarios.

[0068] It should be noted that the values ​​of the calibrated parameters k, b, Vc and Vg are generally not all integers. If the values ​​of k, b, Vc and Vg are all integers, re-calibration is required.

[0069] Temperature drift can be understood as the zero-point drift caused by the change in semiconductor device parameters due to temperature changes. Therefore, temperature drift will cause parameter errors in semiconductor devices. Therefore, for voltage detection devices, changes in ambient temperature will cause changes in the specific voltage value of the reference input voltage inside the voltage detection device. Figure 2 This is a schematic diagram of a temperature correction coefficient versus temperature curve provided in an embodiment of the present application. Figure 2 It can be seen that the coefficient of the reference input voltage (temperature correction coefficient) will also change as the ambient temperature changes. Figure 2 It can be seen from the change curve that the relationship between the temperature correction coefficient of the reference output voltage and the ambient temperature is that each preset Celsius interval corresponds to a coefficient. Therefore, if the current ambient temperature and the current reference output voltage correspond to different preset temperature values, it is necessary to correct the corresponding reference output voltage value according to the temperature correction coefficient corresponding to the current ambient temperature to reduce the temperature drift error and improve the accuracy of voltage detection.

[0070] Detect the ambient temperature. When the difference between the ambient temperature and the preset temperature value exceeds the preset threshold, obtain the temperature correction coefficient according to the temperature coefficient comparison table, and correct the reference output voltage value according to the temperature correction coefficient to obtain the first reference output voltage value. Detect and process the first reference input voltage signal corresponding to the first reference output voltage value to obtain the first reference sampling voltage value. For example, Figure 2 As shown, assuming that the coefficient of the reference output voltage and the temperature relationship is a coefficient for every 4°C interval, assuming that the ambient temperature corresponding to the current reference output voltage value is 25°C, the ambient temperature is detected in real time, and when the difference between the current ambient temperature and the room temperature of 25°C is greater than 4°C, for example, the current ambient temperature is 34°C, the corresponding temperature correction coefficient is obtained from the preset temperature coefficient comparison table. The temperature coefficient comparison table can be used according to Figure 2 The curve is obtained by Figure 2It can be known that when the current ambient temperature is 34°C, the corresponding reference output voltage coefficient is 0.9999, which is the temperature correction coefficient. According to the multiplication of the temperature correction coefficient 0.9999 and the reference output voltage, the corrected first reference output voltage value is obtained. For example, the reference output voltage value Vc is 0.01V, and the reference output voltage value Vg is 2.52V. Then, according to the corresponding temperature correction coefficient 0.9999 when the current ambient temperature is 34°C, the reference output voltage value Vc1 and the reference output voltage value Vg1 are multiplied by the temperature correction coefficient 0.9999 respectively. Among them, the reference output voltage value Vc1 is 0.009999V, and the reference output voltage value Vg1 is 2.519748V. According to the corrected reference output voltage value Vc1 and the reference output voltage value Vg1, the test processing is performed, and the corresponding output first reference sampling voltage values ​​are obtained as the reference sampling voltage value X1 and the reference sampling voltage value X2. At this time, the reference sampling voltage value X1 and the reference sampling voltage value X2 outputted are obtained by transcoding the corresponding ADC code values ​​Code5 and Code6 outputted by the voltage detection device.

[0071] As described above, by establishing a linear function between the known first input voltage value and the code value of the voltage read by the ADC, the impedance error, operational amplifier error, PGA gain error, etc. generated by the signal transmission path are uniformly attributed to the coefficient k and constant b of the linear function, thereby eliminating the error generated by the signal transmission path.

[0072] S102: Correct parameters in a preset first formula according to the first reference sampling voltage value and the first reference output voltage value to obtain a second formula.

[0073] The reference output voltage is corrected according to the difference between the current ambient temperature and the preset temperature value and the temperature coefficient comparison table to obtain the corrected first reference output voltage and the corresponding first reference sampling voltage. Then, the parameters in the preset first formula are corrected by the corrected first reference output voltage and the corresponding first reference sampling voltage to obtain the corresponding correction parameters. The initial parameters in the preset first formula are replaced with the above correction parameters to obtain the second formula, thereby realizing the correction and update of the parameters in the linear function based on the change of ambient temperature.

[0074] In one embodiment, the first reference output voltage value includes a reference output voltage value Vc1 and a reference output voltage value Vg1, and the preset first formula is expressed as Y=kx+b, where Y represents the output voltage value, x represents the sampled voltage value, and k and b represent the parameters of the formula. The reference output voltage value Vc1 and the corresponding reference sampled voltage value X1 are combined with the preset first formula to obtain the formula Vc1=k1(X1)+b1, where the values ​​of k1 and b1 are unknown values. The reference output voltage value Vg1 and the corresponding reference sampled voltage value X2 are combined with the preset first formula to obtain the formula Vg1=k1(X2)+b 1, The values ​​of k1 and b1 are unknown. According to the formula Vc1=k1(X1)+b1 and the formula Vg1=k1(X2)+b1, the values ​​of the parameters k1 and b1 are obtained. According to the values ​​of the parameters k1 and b1 and the preset first formula, the second formula is obtained as Y=k1x+b1, where Y represents the output voltage value, x represents the sampled voltage value, k1 and b1 represent the parameters of the formula, and k1 and b1 are parameters with known values.

[0075] For example, from the above, when the ambient temperature is 34°C, the corresponding reference output voltage value Vc1 is 0.009999V, and the reference output voltage value Vg1 is 2.519748V. At this time, the output reference sampling voltage value X1 and the reference sampling voltage value X2 are obtained by transcoding the corresponding ADC code values ​​Code5 and Code6 output by the voltage detection device. Assuming that the obtained reference sampling voltage value X1 is 0.005724V and the reference sampling voltage value X2 is 2.483265V, the calculation is performed according to the formula Vc1=k1(X1)+b1 and the formula Vg1=k1(X2)+b1, and the parameters k1 are 1.013 and b1 are 0.0042. The parameters k1 is 1.013 and b1 is 0.0042, which are substituted for the initial parameters k (1.010) and b (0.0050) in the preset first formula, and the second formula is Y=1.013x+0.0042.

[0076] As described above, by acquiring the ambient temperature of the voltage detection device in real time and calibrating the k and b values ​​at the temperature point, the detection error caused by the temperature drift of components in the circuit can be reduced.

[0077] S103, receiving an input voltage signal to be detected input by a user, outputting a test sampling voltage value, and performing calculation processing according to the test sampling voltage value and the second formula to obtain an output voltage value corresponding to the input voltage signal to be detected.

[0078] After the reference output voltage and the parameters of the linear function are corrected and calibrated according to the ambient temperature, the voltage detection under the current ambient temperature can be performed. The input voltage signal to be detected input by the user is received, and the voltage value of the input voltage signal to be detected at this time is an unknown voltage value. The voltage detection device performs detection processing and outputs the test sampling voltage. At this time, the output is an ADC code value, and the corresponding test sampling voltage value can be obtained through transcoding processing. According to the test sampling voltage value and the second formula at the corresponding ambient temperature, the output voltage value of the corresponding input voltage signal to be detected can be obtained. In the above, by establishing a linear function between the known first input voltage value and the code value of the ADC reading its voltage, the impedance error, operational amplifier error and PGA gain error generated by the signal transmission path are uniformly calculated to the coefficient k and constant b of the linear function, thereby eliminating the error generated by the signal transmission path. By obtaining the ambient temperature of the voltage detection device in real time and calibrating the k and b values ​​at the temperature point, the detection error caused by the temperature drift of the components in the circuit is reduced. By correcting the circuit parameters based on the ambient temperature, the voltage detection reduces the detection error and reduces the temperature drift error, thereby improving the accuracy of the output voltage value obtained by the detection.

[0079] In one embodiment, since each test will generate some detection errors caused by hardware, after completing the preset number of detections, the current reference output voltage value can be used for detection processing to obtain the corresponding reference sampling voltage value. The current reference output voltage value and the corresponding reference sampling voltage value and the preset initial formula are used for calculation processing to obtain the updated parameters. The updated parameters are used to replace the parameters in the preset first formula to obtain the updated preset first formula.

[0080] Exemplarily, at room temperature, before each detection or multiple detections, the currently known reference output voltage Vc (or Vc1) and Vg (or Vg1) are used as the Y value, and the corresponding detected sampled voltage value is used as the X value, and substituted into the function Y=kx+b, and new k value and b value are calculated respectively, and the original k value and b value are overwritten, and the k value and b value are cyclically updated according to the detection requirements. By updating the parameters of the function (preset first formula) by the reference output voltage before each detection or after multiple detections, the circuit can be calibrated in real time, thereby reducing the detection error of the detection circuit.

[0081] In one embodiment, Figure 3 This is a comparison chart of actual detection accuracy of a circuit at room temperature provided by the embodiment of the present application. Figure 3 Through the above implementation, the voltage detection accuracy at room temperature can be basically less than 0.05%, thereby improving the voltage detection accuracy. Figure 4 This is a table of measured temperature drift coefficients provided in the embodiment of the present application. Figure 4, through the above implementation, the temperature drift at high and low temperatures is less than 5ppm / ℃, while the gain error of the analog-to-digital converter A / D in the voltage detection device without using the above embodiment is 1%, the temperature drift of the analog-to-digital converter A / D is 8ppm / ℃, the reference voltage error is 0.4%, and the temperature drift of the reference voltage is 20ppm / ℃. Therefore, before the above embodiment is used, the voltage signal measurement error of pure hardware is greater than 1%, and the temperature drift error is greater than 20ppm / ℃. Therefore, through the embodiment of the present application, the temperature drift error is reduced, thereby improving the voltage detection accuracy.

[0082] The above can greatly reduce the distortion rate of the input voltage signal, real-time calibration can improve the anti-interference ability, and temperature compensation can reduce the detection error caused by the ambient temperature, ensuring the accuracy of voltage detection within the industrial temperature range. Through the above embodiment, low-cost electronic devices can be used to realize voltage detection, which reduces the cost of voltage detection and improves the accuracy of voltage detection, making the detection value closer to the true value.

[0083] As mentioned above, by detecting the ambient temperature, when the difference between the ambient temperature and the preset temperature value exceeds the preset threshold, the reference output voltage value is corrected according to the temperature coefficient comparison table to obtain the first reference sampling voltage value and the first reference output voltage value, and the parameters in the preset first formula are corrected according to the first reference sampling voltage value and the first reference output voltage value to obtain the second formula, receive the input voltage signal to be detected input by the user, output the test sampling voltage, and calculate and process according to the test sampling voltage value and the second formula to obtain the output voltage value of the corresponding input voltage signal to be tested. By adopting the above technical means, the reference output voltage can be corrected through the temperature coefficient comparison table, and the preset first formula can be corrected based on the corrected first reference output voltage and the corresponding first input reference sampling voltage to obtain the second formula, and voltage detection can be performed based on the second formula to reduce temperature drift error and improve the accuracy of voltage detection. In addition, by correcting the reference voltage, the detection error is reduced, and the accuracy of voltage detection is further improved.

[0084] Based on the above embodiments, Figure 5 is a schematic diagram of a voltage detection circuit provided in an embodiment of the present application, referring to Figure 5, the voltage detection circuit is used to implement the above-mentioned voltage test method, and the voltage detection circuit specifically includes a voltage signal input module 11, a signal acquisition processing module 12, a reference voltage signal module 13, a signal detection chip module 14, a temperature detection circuit module 15 and a switch module 16. The voltage signal input module 11 is connected to the first end and the second end of the switch module 16, and the voltage signal module is used to receive the voltage signal input by the user, and the voltage signal includes a first input voltage signal and an input voltage signal to be detected. The third end and the fourth end of the switch module 16 are connected to the reference voltage signal module 13, and the fifth end and the sixth end of the switch module 16 are connected to the input end of the signal acquisition module. The switch module 16 is used to pass the voltage signal received from the voltage signal input module 11 and the reference voltage signal module 13 to the signal acquisition processing module 12, and the reference voltage signal module 13 is used to provide at least two reference input voltage signals, wherein the two reference input voltages are used for real-time calibration of the entire voltage detection circuit. The output end of the signal acquisition processing module 12 is connected to the first end of the signal detection chip module 14, and the signal acquisition processing circuit module is used to attenuate and filter the voltage signal. The second end of the signal detection chip module 14 is connected to the temperature detection circuit module 15. The signal detection chip module 14 is used to correct the circuit parameters according to the voltage signal received from the signal acquisition circuit module and the ambient temperature value received from the temperature detection circuit module 15, and calculate the input voltage value of the input voltage to be detected.

[0085] In the above, the input voltage signal is attenuated and low-pass filtered through the signal acquisition and processing circuit module, and the signal input impedance is increased to ensure the stability of the sampling environment and expand the sampling range of the voltage signal.

[0086] Figure 6 is another schematic diagram of a voltage detection circuit provided in an embodiment of the present application, referring to Figure 6 The signal acquisition and processing circuit module uses the operational amplifier TP5592-VR as a voltage follower to increase the input impedance of the circuit. The attenuation coefficient in the circuit is R6 / (R5+R6+R7)=0.2, and the low-pass filter cutoff frequency is 2.6kHz. The capacitance of the differential mode capacitor C3 and the common mode capacitors C2 and C4 should not be too large, otherwise it will increase the voltage establishment time.

[0087] Reference Figure 6, Vin+ and Vin- of the voltage signal input module 11 are all external voltage signal input terminals, which are used to receive the first input voltage signal and the input voltage signal to be detected input by the user, wherein the first input voltage signal is a voltage signal with a known voltage value, and the input voltage signal to be detected is a voltage signal with an unknown voltage value. The negative input terminal Vin- of the voltage signal input module 11 is provided with a bias voltage by resistors R1 and R2. When calibration is required, a known voltage signal can be connected, and a high-precision voltage source meter, such as 5520A, can be connected. After calibration, an unknown voltage signal can be directly tested.

[0088] Reference Figure 6 The reference voltage signal module 13 uses AN431AN, which can output two reference voltages Vc=0V and Vg=2.5V to calibrate the parameters of the entire circuit in real time. The resistors R3 and R4 are used to generate the same bias voltage as Vin-, so that the voltage signals of the circuits of the voltage signal input module 11 and the reference voltage signal module 13 are in the same linear region collected by the ADC. Figure 5 When the positive and negative input terminals of the signal acquisition processing module 12 are respectively connected to switches S3 and S6, the reference voltage signal module 13 provides Vc=0V, and when the positive and negative input terminals of the signal acquisition processing module 12 are respectively connected to switches S2 and S5, the reference voltage signal module 13 provides Vc=2.5V. It should be noted that the reference voltage can be selected according to actual needs and is not limited to 2.5V.

[0089] In one embodiment, an implementation method is provided in which the coefficient of the reference voltage signal module 13 varies with temperature. Figure 2 This curve is the variation law of AN431AN used as reference voltage, which can be applied to temperature compensation of voltage acquisition and stored in MCU in array form for correction of reference input voltage. When the room temperature T=25℃, the measured reference sampling voltage value is stored in MCU, and the reference voltage value is stored in MCU. Figure 2 Curve, the coefficient at this time is 1. When the measured ambient temperature changes, the reference sampling voltage value can be corrected according to the coefficient at different temperatures. Figure 6 The temperature detection circuit module 15 in the embodiment adopts the M601Z single bus temperature detection chip, which has a built-in temperature sensor and transmits the actual temperature directly to the MCU through the DQ data line. The environmental detection accuracy is 0.1°C.

[0090] In one embodiment, the signal detection chip module 14 is used to collect and process voltage signal data and ambient temperature data. The signal detection chip module 14 uses a ZML166 signal detection chip, refer to Figure 6 The signal detection chip module 14 has an embedded MCU and a 24-bit ADC to meet the requirements of high-precision signal acquisition and data processing.

[0091] In the above, the ambient temperature is detected by the temperature detection circuit module, and the signal detection chip module determines that when the difference between the ambient temperature and the preset temperature value exceeds the preset threshold value, the reference output voltage value is corrected according to the temperature coefficient comparison table to obtain the first reference sampling voltage value and the first reference output voltage value, and the parameters in the preset first formula are corrected according to the first reference sampling voltage value and the first reference output voltage value to obtain the second formula, and the input voltage signal to be detected input by the user is received through the voltage signal input module, and the test sampling voltage is output through the signal detection chip module. The calculation and processing are performed according to the test sampling voltage value and the second formula to obtain the output voltage value of the corresponding input voltage signal to be tested. By adopting the above technical means, the reference output voltage can be corrected through the temperature coefficient comparison table, and the preset first formula is corrected based on the corrected first reference output voltage and the corresponding first input reference sampling voltage to obtain the second formula, and voltage detection is performed based on the second formula, thereby reducing the temperature drift error and improving the accuracy of voltage detection. In addition, by correcting the reference voltage, the detection error is reduced, and the accuracy of voltage detection is further improved.

[0092] The voltage detection circuit provided in the embodiment of the present application can be used to execute the voltage detection method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0093] The present application embodiment provides a voltage detection device, referring to Figure 7 The voltage detection device includes: a processor 31, a memory 32, a communication module 33, an input device 34 and an output device 35. The number of processors in the voltage detection device can be one or more, and the number of memories in the voltage detection device can be one or more. The processor, memory, communication module, input device and output device of the voltage detection device can be connected via a bus or other means.

[0094] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the voltage detection method described in any embodiment of the present application (for example, a voltage signal input module, a switch module, a signal acquisition processing module, a reference voltage signal module, a signal detection chip module and a temperature detection circuit module in a voltage detection circuit). The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0095] The communication module 33 is used for data transmission.

[0096] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory, that is, implements the above-mentioned voltage detection method.

[0097] The input device 34 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 35 may include a display device such as a display screen.

[0098] The voltage detection device provided above can be used to execute the voltage detection method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0099] An embodiment of the present application also provides a storage medium storing computer executable instructions, which are used to execute a voltage detection method when executed by a computer processor. The voltage detection method includes: detecting the ambient temperature, and when the difference between the ambient temperature and a preset temperature value exceeds a preset threshold value, correcting the reference output voltage value according to a temperature coefficient comparison table to obtain a first reference sampling voltage value and a first reference output voltage value; correcting the parameters in a preset first formula according to the first reference sampling voltage value and the first reference output voltage value to obtain a second formula; receiving an input voltage signal to be detected input by a user, outputting a test sampling voltage value, and performing calculation processing according to the test sampling voltage value and the second formula to obtain the output voltage value of the corresponding input voltage signal to be detected.

[0100] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0101] Of course, the computer executable instructions of a storage medium storing computer executable instructions provided in an embodiment of the present application are not limited to the voltage detection method described above, and can also execute related operations in the voltage detection method provided in any embodiment of the present application.

[0102] The voltage detection device, storage medium and voltage detection equipment provided in the above embodiments can execute the voltage detection method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the voltage detection method provided in any embodiment of the present application.

[0103] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A voltage detection method, characterized in that: include: Receive at least two first input voltage signals input by a user, and obtain corresponding at least two first sampled voltage values, wherein the first input voltage signal is a voltage signal corresponding to the first input voltage value; Obtaining an initial parameter and a corresponding preset temperature value according to the at least two first sampled voltage values ​​and the corresponding at least two first input voltage values ​​and a preset initial formula; Replacing the parameters in the preset initial formula with the initial parameters to obtain a preset first formula, wherein the preset first formula is associated with the preset temperature value; Detect and process two preset reference input voltages and output two corresponding ADC code values; Transcoding the two ADC code values ​​to obtain two corresponding reference sampling voltage values; Calculate and process according to a preset first formula and the reference sampling voltage value to obtain a reference output voltage value corresponding to the reference input voltage signal; Detecting the ambient temperature, when the difference between the ambient temperature and the preset temperature value exceeds a preset threshold, correcting the reference output voltage value according to the temperature coefficient comparison table to obtain a first reference sampling voltage value and a first reference output voltage value; According to the first reference sampling voltage value and the first reference output voltage value, the parameters in the preset first formula are corrected to obtain a second formula; An input voltage signal to be detected input by a user is received, a test sampling voltage value is output, and calculation processing is performed according to the test sampling voltage value and the second formula to obtain an output voltage value corresponding to the input voltage signal to be detected.

2. The method according to claim 1, characterized in that The detecting of the ambient temperature, when the difference between the ambient temperature and the preset temperature value exceeds a preset threshold, correcting the reference output voltage value according to the temperature coefficient comparison table to obtain a first reference sampling voltage value and a first reference output voltage value, comprises: Detecting the ambient temperature, when the difference between the ambient temperature and the preset temperature value exceeds the preset threshold, obtaining the temperature correction coefficient according to the temperature coefficient comparison table; Correcting the reference output voltage value according to the temperature correction coefficient to obtain a first reference output voltage value; Detecting and processing a first reference voltage signal corresponding to the first reference output voltage value to obtain a corresponding first reference sampling voltage value; The step of correcting the parameters in the preset first formula according to the first reference sampling voltage value and the first reference output voltage value to obtain the second formula includes: Correcting the parameters in the preset first formula according to the first reference sampling voltage value and the first reference output voltage value to obtain corresponding correction parameters; The initial parameters in the preset first formula are replaced by the modified parameters to obtain the second formula.

3. The method according to claim 1, characterized in that After receiving the input voltage signal to be detected input by the user and performing calculation processing according to the output test sample voltage value and the second formula to obtain the output voltage value of the corresponding input voltage signal to be detected, the method includes: After completing the preset number of detections, the current reference output voltage value is used for detection processing to obtain the corresponding reference sampling voltage value; Calculate and process the current reference output voltage value, the corresponding reference sampling voltage value and the preset initial formula to obtain the updated parameter; The updated parameters are used to replace the parameters in the preset first formula to obtain an updated preset first formula.

4. The method according to claim 1, characterized in that: The first reference output voltage value includes a reference output voltage value Vc1 and a reference output voltage value Vg1, and the preset first formula is expressed as Y=kx+b, where Y represents the output voltage value, x represents the sampled voltage value, and k and b represent parameters of the formula; The step of correcting the parameters in the preset first formula according to the first reference sampling voltage value and the first reference output voltage value to obtain the second formula includes: The reference output voltage value Vc1 and the corresponding reference sampling voltage value X1 are combined with the preset first formula to obtain the formula Vc1=k1(X1)+b1, where the values ​​of k1 and b1 are unknown values; The reference output voltage value Vg1 and the corresponding reference sampling voltage value X2 are combined with the preset first formula to obtain the formula Vg1=k1(X2)+b1, where the values ​​of k1 and b1 are unknown values; Calculate and process according to the formula Vc1=k1(X1)+b1 and the formula Vg1=k1(X2)+b1 to obtain the values ​​of parameters k1 and b1; According to the values ​​of the parameters k1 and b1 and the preset first formula, the second formula is obtained as Y=k1x+b1, where Y represents the output voltage value, x represents the sampled voltage value, k1 and b1 represent the parameters of the formula, and k1 and b1 are parameters with known values.

5. A voltage detection circuit, used to implement the voltage testing method according to any one of claims 1 to 4, characterized in that: It includes a voltage signal input module, a signal acquisition and processing module, a reference voltage signal module, a signal detection chip module, a temperature detection circuit module and a switch module; The voltage signal input module is connected to the first end and the second end of the switch module, and the voltage signal module is used to receive a voltage signal input by a user, wherein the voltage signal includes a first input voltage signal and an input voltage signal to be detected; The third end and the fourth end of the switch module are connected to the reference voltage signal module, the fifth end and the sixth end of the switch module are connected to the input end of the signal acquisition module, the switch module is used to transmit the voltage signal received from the voltage signal input module and the reference voltage signal module to the signal acquisition processing module, and the reference voltage signal module is used to provide at least two reference input voltage signals; The output end of the signal acquisition and processing module is connected to the first end of the signal detection chip module, and the signal acquisition and processing circuit module is used to perform attenuation and filtering processing on the voltage signal; The second end of the signal detection chip module is connected to the temperature detection circuit module. The signal detection chip module is used to correct the circuit parameters according to the voltage signal received from the signal acquisition circuit module and the ambient temperature value received from the temperature detection circuit module, and calculate the input voltage value of the input voltage to be detected.

6. A voltage detection device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

7. A storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a processor, they are used to perform the method according to any one of claims 1 to 4.