An electrical signal correction method for resistor sampling

Through theoretical zero point and gain correction, the problem of output inaccuracy caused by environmental interference and circuit aging during the resistor sampling process is solved, achieving higher signal sampling accuracy and stability, ensuring the accuracy and real-time output voltage sex.

CN118157671BActive Publication Date: 2024-09-13北京精微致合测试技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410277346.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2024-09-13
Estimated Expiration
2044-03-12

AI Technical Summary

Technical Problem

In the existing technology, the output data is inaccurate due to environmental interference and circuit aging during the resistor sampling process, which affects the accuracy and stability of signal correction.

Method used

Through theoretical zero point correction and gain correction, the resistance value of the sampling resistor and the gain of the amplifier are adjusted in real time to eliminate the zero point offset and gain deviation of the circuit and ensure the accuracy and stability of the output voltage.

Benefits of technology

It improves the accuracy and reliability of circuit sampling, reduces deviations caused by environmental changes and circuit aging, ensures that the output voltage accurately reflects signal characteristics, reduces measurement errors, and improves the quality and real-time performance of signal sampling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118157671B
    Figure CN118157671B
Patent Text Reader

Abstract

The present invention relates to the technical field of electrical signal processing, and in particular to an electrical signal correction method for resistor sampling, comprising: step S1, theoretical zero point correction; step S2, theoretical gain correction; step S3, determining actual correction; step S4, actual zero point correction; step S5, actual gain correction. The present invention corrects the output voltage of the circuit through theoretical zero point correction and gain correction, reduces the correction error, improves the accuracy and reliability of circuit sampling, adjusts and corrects the error in real time through actual zero point and gain correction, and the corrected output voltage can more accurately reflect the measured signal characteristics, determines whether actual correction is required through a preset error threshold, ensures that the corrected output result meets the preset accuracy and stability requirements, measures and adjusts the output voltage of the sampling circuit in real time, and improves the real-time performance and responsiveness of the correction process in the electrical signal acquisition process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric signal processing, and in particular to an electric signal correction method for resistor sampling. Background Art

[0002] In today's technological development and engineering applications, many fields require the use of precision circuits and sensors for data acquisition and signal processing to achieve various functions and controls. However, due to the influence of factors such as environmental and temperature changes, components in the circuit often have problems such as drift and error, resulting in inaccuracy and instability in the output data.

[0003] The patent document with the publication number CN109601009A discloses a temperature sensor calibration method, which comprises: an original resistance value acquisition step, sampling the original resistance value of each temperature sensor and acquiring its original resistance value; a calculation step, calculating the correction coefficient for correcting the temperature based on the difference between the acquired original resistance value and the resistance value measured by the standard thermometer; a storage step, storing the correction coefficient in the storage medium of the measuring device; and a step of sending the correction coefficient to the thermometer body. Since the accuracy of the original resistance value acquisition is affected by factors such as environmental conditions and circuit interference, it may cause a certain error in the original resistance value obtained by sampling, thereby affecting the accuracy of the correction coefficient finally calculated. The correction coefficient is stored in the storage medium of the measuring device. As time goes by, the storage medium of the measuring device may age and cause poor performance. It needs to be regularly checked and updated to ensure the timeliness and accuracy of the correction coefficient. If the stored correction coefficient is outdated or invalid, the measurement result of the temperature sensor is inaccurate. Summary of the invention

[0004] To this end, the present invention provides an electrical signal correction method for resistor sampling, so as to overcome the problems in the prior art that the original electrical signal is inaccurate due to environmental interference in the collection of the original electrical signal, and the resistor may age due to long-term use, resulting in its performance degradation, thereby affecting the sampling effect of the electrical signal.

[0005] To achieve the above object, the present invention provides an electrical signal correction method for resistor sampling, which is characterized by comprising:

[0006] Step S1, performing theoretical zero point correction on the output voltage of the circuit according to the measured output voltage of the circuit connected with the sampling resistor and the measured output voltage of the circuit when the sampling resistor is not connected, so as to obtain a first corrected output voltage, obtaining the difference between the output voltage of the circuit connected with the sampling resistor and the output voltage of the circuit to be corrected when the sampling resistor is not connected, and comparing the difference with a preset output voltage difference threshold, and judging whether the first corrected output voltage needs to be corrected by theoretical gain according to the comparison result;

[0007] Step S2, for a first corrected output voltage that needs theoretical gain correction, connect a reference resistor of known resistance value to the circuit, measure the output voltage of the circuit after the reference resistor is connected, calculate a gain correction factor according to the first corrected output voltage and the measured output voltage of the circuit after the reference resistor is connected, and correct the first corrected output voltage according to the gain correction factor and the first corrected output voltage to obtain a second corrected output voltage;

[0008] Step S3, connecting a reference resistor to the circuit, measuring the second corrected output voltage, calculating a relative error according to the first corrected output voltage and the second corrected output voltage, and determining whether the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction by comparing the relative error with a preset error threshold;

[0009] Step S4, for the second calibrated output voltage that needs to adjust the zero point calibration and the gain calibration, determine the direction of the actual offset of the first calibrated output voltage according to the relative error, adjust the resistance value of the sampling resistor according to the direction of the actual offset, and measure the output voltage of the circuit connected with the sampling resistor after the adjustment resistor in real time until the output voltage measured in real time is equal to the first calibrated output voltage;

[0010] Step S5, adjusting the gain of the amplifier in the circuit for amplifying the output voltage of the sampling resistor according to the gain correction factor and the first corrected output voltage, so that the output voltage reaches the second corrected output voltage.

[0011] Further, in step S1, the theoretical zero point correction is to subtract the output voltage of the circuit connected to the sampling resistor from the output voltage of the circuit when the sampling resistor is not connected to obtain a difference in theoretical zero point correction, apply the difference in theoretical zero point correction to the output voltage of the circuit, and calculate the sum of the output voltage of the circuit when the sampling resistor is not connected and the difference in theoretical zero point correction to obtain a first corrected output voltage.

[0012] Furthermore, in step S1, a preset output voltage difference threshold is set, and the difference of the theoretical zero point correction is compared with the output voltage difference threshold to determine whether the first corrected output voltage needs to be corrected by theoretical gain.

[0013] If the difference of the theoretical zero point correction is less than or equal to the output voltage difference threshold, it is determined that a theoretical gain correction is required;

[0014] If the difference of the theoretical zero point correction is greater than the output voltage difference threshold, it is determined that no theoretical gain correction is required.

[0015] Further, in the step S2, the gain correction factor is calculated by calculating the ratio of the first corrected output voltage to the measured output voltage of the circuit connected with the reference resistor.

[0016] Further, in the step S2, the first corrected output voltage is corrected according to the gain correction factor and the first corrected output voltage, and the gain correction factor is multiplied by the first corrected output voltage to obtain a second corrected output voltage.

[0017] Further, in step S3, the relative error is calculated based on the first corrected output voltage and the second corrected output voltage, and the relative error is obtained by taking the difference between the first corrected output voltage and the second corrected output voltage and taking the ratio of the difference between the first corrected output voltage and the second corrected output voltage to the first corrected output voltage.

[0018] Furthermore, in step S3, a preset error threshold is set, and by comparing the relative error with the preset error threshold, it is determined whether the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction.

[0019] If the relative error is greater than the error threshold, determining that the second calibrated output voltage needs to be subjected to actual zero point calibration and actual gain calibration;

[0020] If the relative error is less than the error threshold, it is determined that the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction.

[0021] Further, in the step S4, the direction of the actual offset of the first corrected output voltage is determined according to the relative error.

[0022] If the relative error is greater than zero, it is determined that the direction of the actual offset of the first corrected output voltage is positive, and a negative offset adjustment is required;

[0023] If the relative error is less than zero, it is determined that the direction of the actual offset of the first corrected output voltage is negative, and a positive offset adjustment is required.

[0024] Further, in the step S4, a preset resistance adjustment step is set, and the resistance value of the sampling resistor is adjusted according to the direction of the actual offset and the resistance adjustment step.

[0025] If the direction of the actual offset of the first calibrated output voltage is positive, reducing the resistance value of the sampling resistor according to a preset adjustment resistance value step;

[0026] If the direction of the actual offset of the first calibrated output voltage is negative, the resistance value of the sampling resistor is increased according to a preset adjustment resistance value step.

[0027] Further, in step S5, adjusting the gain of an amplifier in the circuit for amplifying the output voltage of the sampling resistor according to the gain correction factor and the first corrected output voltage comprises:

[0028] The output voltage difference between the first corrected output voltage and the second corrected output voltage is calculated according to the correction gain factor, A=(BC)×D, wherein A is the output voltage difference, B is the second corrected output voltage, C is the first corrected output voltage, and D is the correction gain factor. The gain of the amplifier is determined according to the output voltage difference, and the gain of the amplifier is adjusted according to the determination result and a preset gain adjustment step.

[0029] If the output voltage difference is greater than zero, it is determined that the gain of the amplifier needs to be increased and adjusted, and the gain of the amplifier is increased and adjusted according to the gain adjustment step;

[0030] If the output voltage difference is less than zero, it is determined that the gain of the amplifier needs to be reduced and adjusted, and the gain of the amplifier is reduced and adjusted according to the gain adjustment step.

[0031] Compared with the prior art, the beneficial effects of the present invention are that, through theoretical zero point correction and gain correction, the output voltage of the circuit is corrected, the correction error is reduced, and the accuracy and reliability of circuit sampling are further improved; through actual zero point and gain correction, the error is adjusted and corrected in real time, so that the output voltage is more stable, and the deviation caused by factors such as environmental changes and circuit aging is reduced; the output voltage after correction can more accurately reflect the measured signal characteristics, improve the quality of signal sampling, and reduce measurement errors; by judging whether actual zero point and gain correction is needed according to a preset error threshold, it is ensured that the output result after correction meets the preset accuracy and stability requirements; the output voltage of the sampling circuit is measured and adjusted in real time, so that the correction process can be carried out in real time during the electrical signal acquisition process, thereby improving real-time performance and responsiveness.

[0032] Furthermore, through theoretical zero point correction, the output voltage of the circuit connected to the sampling resistor is compared with the output voltage when the sampling resistor is not connected, and the difference of the theoretical zero point correction is obtained, which is used to correct the output voltage of the circuit to obtain a first corrected output voltage, which can eliminate the zero point offset of the circuit and make the output voltage more accurate.

[0033] Furthermore, by comparing the difference of the theoretical zero point correction with the output voltage difference threshold, it can be determined whether the correction gain is necessary. If the difference is small, it means that the correction offset is small, and the theoretical gain correction is not required, thereby saving the time and cost of correction. Only when the difference is large, the theoretical gain correction is performed to ensure the accuracy and precision of the correction.

[0034] Furthermore, the correction effect and the accuracy of the output voltage are improved through gain correction. By calculating the gain correction factor, the first corrected output voltage can be adjusted to make it more accurately meet the correction standard. This can eliminate deviations caused by factors such as changes in circuit component parameters and temperature changes, and improve the accuracy and stability of electrical signal correction.

[0035] Furthermore, by calculating and judging the relative error, it is determined whether it is necessary to perform actual zero point and gain correction on the second correction output voltage. By setting the error threshold, the accuracy of the correction can be judged according to actual needs and precision requirements. If the relative error exceeds the error threshold, it means that the second correction output voltage deviates from expectations and further adjustments are required in terms of actual zero point and gain. This can ensure that the correction result is more accurate and precise.

[0036] Furthermore, the actual offset of the first corrected output voltage is adjusted by adjusting the direction of the actual offset and the change of the adjustment resistance value. By adjusting the resistance value of the sampling resistor according to the direction of the relative error, the actual offset in the circuit can be eliminated and matched with the theoretical correction value.

[0037] Furthermore, the output voltage is made to reach the second corrected output voltage by adjusting the gain of the amplifier, thereby achieving the accuracy and precision of the correction. The gain of the amplifier is gradually adjusted according to the judgment of the output voltage difference to achieve precise adjustment of the correction result. In this way, it can be ensured that the corrected output voltage more accurately reflects the measured signal characteristics, thereby improving the accuracy and stability of the correction result. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a flow chart of the electrical signal correction method for resistor sampling in this embodiment;

[0039] Figure 2 A decision logic diagram for performing gain correction on the first corrected output voltage of this embodiment;

[0040] Figure 3 A decision logic diagram for performing actual zero point correction and actual gain correction on the second corrected output voltage of this embodiment;

[0041] Figure 4 The decision logic diagram for determining the direction of the actual offset in this embodiment. DETAILED DESCRIPTION

[0042] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0043] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0044] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.

[0045] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0046] See also Figure 1 As shown, it is a flow chart of the electrical signal correction method for resistor sampling in this embodiment; this embodiment provides an electrical signal correction method for resistor sampling, which is characterized by comprising:

[0047] Step S1, performing theoretical zero point correction on the output voltage of the circuit according to the measured output voltage of the circuit connected with the sampling resistor and the measured output voltage of the circuit when the sampling resistor is not connected, so as to obtain a first corrected output voltage, obtaining the difference between the output voltage of the circuit connected with the sampling resistor and the output voltage of the circuit to be corrected when the sampling resistor is not connected, and comparing the difference with a preset output voltage difference threshold, and judging whether the first corrected output voltage needs to be corrected by theoretical gain according to the comparison result;

[0048] Step S2, for a first corrected output voltage that needs theoretical gain correction, connect a reference resistor of known resistance value to the circuit, measure the output voltage of the circuit after the reference resistor is connected, calculate a gain correction factor according to the first corrected output voltage and the measured output voltage of the circuit after the reference resistor is connected, and correct the first corrected output voltage according to the gain correction factor and the first corrected output voltage to obtain a second corrected output voltage;

[0049] Step S3, connecting a reference resistor to the circuit, measuring the second corrected output voltage, calculating a relative error according to the first corrected output voltage and the second corrected output voltage, and determining whether the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction by comparing the relative error with a preset error threshold;

[0050] Step S4, for the second calibrated output voltage that needs to adjust the zero point calibration and the gain calibration, determine the direction of the actual offset of the first calibrated output voltage according to the relative error, adjust the resistance value of the sampling resistor according to the direction of the actual offset, and measure the output voltage of the circuit connected with the sampling resistor after the adjustment resistor in real time until the output voltage measured in real time is equal to the first calibrated output voltage;

[0051] Step S5, adjusting the gain of the amplifier in the circuit for amplifying the output voltage of the sampling resistor according to the gain correction factor and the first corrected output voltage, so that the output voltage reaches the second corrected output voltage.

[0052] Steps of error judgment, actual correction and amplifier adjustment. First, a theoretical zero point correction is performed by comparing the output voltage when the sampling resistor is connected and when it is not connected. Next, the gain correction factor is calculated by connecting a reference resistor and measuring the output voltage, and the first corrected output voltage is corrected according to the gain correction factor. Then, the second corrected output voltage is measured again, the relative error is calculated, and by comparing the preset error threshold, it is determined whether an actual zero point and gain correction is required. For the second corrected output voltage that needs to be corrected, the direction of the actual offset is determined according to the relative error, the resistance value of the sampling resistor is adjusted, and the output voltage is measured in real time until it is equal to the first corrected output voltage. Finally, according to the gain correction factor and the first corrected output voltage, the gain of the amplifier is adjusted so that the output voltage reaches the second corrected output voltage.

[0053] Through theoretical zero point correction and gain correction, the output voltage of the circuit is corrected, the correction error is reduced, and the accuracy and reliability of circuit sampling are further improved. Through actual zero point and gain correction, the error is adjusted and corrected in real time, making the output voltage more stable and reducing deviations caused by factors such as environmental changes and circuit aging. The corrected output voltage can more accurately reflect the measured signal characteristics, improve the quality of signal sampling, and reduce measurement errors. By judging whether actual zero point and gain correction are needed based on a preset error threshold, it is ensured that the corrected output result meets the preset accuracy and stability requirements. The output voltage of the sampling circuit is measured and adjusted in real time, so that the correction process can be carried out in real time during the electrical signal acquisition process, improving real-time and responsiveness.

[0054] Specifically, in step S1, the theoretical zero point correction is to subtract the output voltage of the circuit connected to the sampling resistor from the output voltage of the circuit when the sampling resistor is not connected to obtain the difference of the theoretical zero point correction, apply the difference of the theoretical zero point correction to the output voltage of the circuit, and calculate the sum of the output voltage of the circuit when the sampling resistor is not connected and the difference of the theoretical zero point correction to obtain a first corrected output voltage.

[0055] Through theoretical zero point correction, the output voltage of the circuit connected with the sampling resistor is compared with the output voltage when the sampling resistor is not connected, and the difference of the theoretical zero point correction is obtained, which is used to correct the output voltage of the circuit to obtain the first corrected output voltage, which can eliminate the zero point offset of the circuit and make the output voltage more accurate.

[0056] Please continue reading Figure 2 As shown, it is a decision logic diagram for gain correction of the first correction output voltage in this embodiment;

[0057] Specifically, in step S1, a preset output voltage difference threshold is set, and the difference of the theoretical zero point correction is compared with the output voltage difference threshold to determine whether the first corrected output voltage needs to be corrected by theoretical gain.

[0058] If the difference of the theoretical zero point correction is less than or equal to the output voltage difference threshold, it is determined that a theoretical gain correction is required;

[0059] If the difference of the theoretical zero point correction is greater than the output voltage difference threshold, it is determined that no theoretical gain correction is required.

[0060] By comparing the difference of the theoretical zero point correction with the output voltage difference threshold, it can be determined whether the correction gain is necessary. If the difference is small, it means that the correction offset is small, and the theoretical gain correction is not required, thus saving the time and cost of correction. Only when the difference is large, the theoretical gain correction will be performed to ensure the accuracy and precision of the correction.

[0061] The output voltage difference threshold is the basis for judging whether to perform theoretical gain correction, which depends on the measurement accuracy and requirements of the output voltage, as well as the requirements for the circuit working performance. Generally speaking, the setting of the output voltage difference threshold should take into account factors such as the noise level of the measured signal, the accuracy and stability of the sampling circuit, etc. A smaller threshold can improve the accuracy of the correction, but may increase the additional correction calculation burden and time cost. A larger threshold may reduce the calculation burden and time cost, but may reduce the accuracy of the correction. The common threshold range can be between 0.1% and 1%. The specific value should be evaluated and adjusted according to the actual situation. For applications with high precision requirements, a smaller threshold is generally selected; for general applications, a larger threshold may be more appropriate. Therefore, the setting of the specific output voltage difference threshold should be evaluated and selected according to the actual situation. In this embodiment, the output voltage difference threshold is 1%, which reduces the calculation burden and time cost.

[0062] Specifically, in step S2, the gain correction factor is calculated by calculating the ratio of the first corrected output voltage to the measured output voltage of the circuit connected with the reference resistor.

[0063] Specifically, in the step S2, the first corrected output voltage is corrected according to the gain correction factor and the first corrected output voltage, and the gain correction factor is multiplied by the first corrected output voltage to obtain a second corrected output voltage.

[0064] Based on the measured output voltage of the circuit after connecting the reference resistor and the first corrected output voltage, a gain correction factor, that is, the ratio of the two, is calculated. Then, the first corrected output voltage is corrected based on the gain correction factor and the first corrected output voltage, that is, the gain correction factor is multiplied by the first corrected output voltage to obtain the second corrected output voltage.

[0065] Gain correction improves the correction effect and the accuracy of the output voltage. By calculating the gain correction factor, the first corrected output voltage can be adjusted to make it more accurately meet the correction standard. This can eliminate deviations caused by factors such as changes in circuit component parameters and temperature changes, and improve the accuracy and stability of electrical signal correction.

[0066] Specifically, in step S3, the relative error is calculated based on the first corrected output voltage and the second corrected output voltage, and the relative error is obtained by taking the difference between the first corrected output voltage and the second corrected output voltage and taking the ratio of the difference between the first corrected output voltage and the second corrected output voltage to the first corrected output voltage.

[0067] like Figure 3 As shown, it is a decision logic diagram for actual zero point correction and actual gain correction of the second correction output voltage in this embodiment;

[0068] Specifically, in step S3, a preset error threshold is set, and by comparing the relative error with the preset error threshold, it is determined whether the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction.

[0069] If the relative error is greater than the error threshold, determining that the second calibrated output voltage needs to be subjected to actual zero point calibration and actual gain calibration;

[0070] If the relative error is less than the error threshold, it is determined that the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction.

[0071] The relative error is calculated by calculating the difference between the first corrected output voltage and the second corrected output voltage and taking the ratio of the difference to the first corrected output voltage. At the same time, an error threshold is preset as a judgment standard, and by comparing the relative error with the preset error threshold, it is judged whether the second corrected output voltage needs to be subjected to the steps of actual zero point correction and actual gain correction.

[0072] By calculating and judging the relative error, it is determined whether the actual zero point and gain correction of the second correction output voltage is required. By setting the error threshold, the accuracy of the correction can be judged according to actual needs and precision requirements. If the relative error exceeds the error threshold, it means that the second correction output voltage deviates from expectations and further adjustments are required in terms of the actual zero point and gain. This can ensure that the correction result is more accurate and precise.

[0073] The error threshold is a limit value used to determine whether the second correction output voltage needs to be actually zero-point corrected and actually gain corrected. The setting of the error threshold should comprehensively consider factors such as the noise level of the signal, the acceptable error range of the correction, and the accuracy requirements of the output results. A smaller error threshold can improve the accuracy of the correction, but it may increase the additional correction calculation burden and time cost. A larger error threshold may reduce the calculation burden and time cost, but may reduce the accuracy of the correction. In general, for the setting of the error threshold, it can be considered to be set in the range of 1% to 5%. This range can be applied to many common electrical signal correction scenarios. In this embodiment, the error threshold is set to 3%.

[0074] like Figure 4 As shown, it is a decision logic diagram for determining the direction of the actual offset in this embodiment;

[0075] Specifically, in step S4, the direction of the actual offset of the first corrected output voltage is determined according to the relative error.

[0076] The direction of the actual offset of the first corrected output voltage (Vc1) is determined according to the relative error (E). If the relative error is greater than zero, that is, E>0, it is determined that the direction of the actual offset of the first corrected output voltage (Vc1) is positive, and a negative offset adjustment is required. If the relative error is less than zero, that is, E<0, it is determined that the direction of the actual offset of the first corrected output voltage (Vc1) is negative, and a positive offset adjustment is required.

[0077] Specifically, in step S4, a preset resistance adjustment step of 1% is set, and the resistance value of the sampling resistor is adjusted according to the direction of the actual offset and the resistance adjustment step.

[0078] If the actual offset direction of the first calibrated output voltage (Vc1) is positive, that is, a negative offset adjustment is required, then the resistance value of the sampling resistor is reduced according to the preset adjustment resistance value step. For example, if the initial resistance value of the sampling resistor is 10Ω, according to the actual offset direction, the adjustment resistance value is reduced by 1%, that is, the resistance value of the sampling resistor is adjusted to 9.9Ω. Then, the output voltage of the circuit connected to the sampling resistor with the adjustment resistor is measured in real time until the output voltage measured in real time is equal to the first calibrated output voltage (Vc1);

[0079] If the actual offset direction of the first calibrated output voltage (Vc1) is negative, that is, a positive offset adjustment is required, then the resistance value of the sampling resistor is increased according to the preset adjustment resistance value step. For example, if the initial resistance value of the sampling resistor is 10Ω, according to the actual offset direction, the adjustment resistance value is increased by 1%, that is, the resistance value of the sampling resistor is adjusted to 10.1Ω. Then, the output voltage of the circuit connected to the sampling resistor with the adjustment resistor is measured in real time until the output voltage measured in real time is equal to the first calibrated output voltage (Vc1).

[0080] The direction of the actual offset of the first corrected output voltage is determined according to the direction of the relative error, and then, in the case of a preset adjustment resistance value step, the resistance value of the sampling resistor is adjusted according to the direction of the actual offset and the adjustment resistance value step. For a positive offset, the adjustment is made by reducing the resistance value of the sampling resistor; for a negative offset, the adjustment is made by increasing the resistance value of the sampling resistor.

[0081] The actual offset of the first corrected output voltage is adjusted by the direction of the actual offset and the change of the adjustment resistance value. By adjusting the resistance value of the sampling resistor according to the direction of the relative error, the actual offset in the circuit can be eliminated and matched with the theoretical correction value.

[0082] The step size of adjusting the resistance value is the amount of change each time the resistance value of the sampling resistor is adjusted, which is used to control the adjustment range of the actual offset. The setting of the step size of adjusting the resistance value should comprehensively consider factors such as system requirements, correction targets, output accuracy requirements, correction time and calculation complexity. A smaller step size can achieve finer adjustments, but may increase additional calculation burden and correction time. A larger step size can reduce the calculation burden and correction time, but may sacrifice some correction accuracy. Generally speaking, the step size of adjusting the resistance value can be set in the range of 0.1% to 1%. The specific range of values ​​needs to be determined according to the needs of the actual application and the performance of the equipment. If a higher correction accuracy is required, a smaller step size, such as 0.1%, can be selected. For scenarios with general requirements, a larger step size such as 1% may be more appropriate. In this embodiment, the step size of adjusting the resistance value is set to 1%.

[0083] Specifically, in step S5, adjusting the gain of an amplifier in the circuit for amplifying the output voltage of the sampling resistor according to the gain correction factor and the first corrected output voltage includes:

[0084] The output voltage difference between the first corrected output voltage and the second corrected output voltage is calculated according to the correction gain factor, A=(BC)×D, wherein A is the output voltage difference, B is the second corrected output voltage, C is the first corrected output voltage, and D is the correction gain factor. The gain of the amplifier is determined according to the output voltage difference, and the gain of the amplifier is adjusted according to the determination result and a preset gain adjustment step.

[0085] If the output voltage difference is greater than zero, it is determined that the gain of the amplifier needs to be increased and adjusted, and the gain of the amplifier is increased and adjusted according to the gain adjustment step;

[0086] If the output voltage difference is less than zero, it is determined that the gain of the amplifier needs to be reduced and adjusted, and the gain of the amplifier is reduced and adjusted according to the gain adjustment step.

[0087] The output voltage difference between the first corrected output voltage and the second corrected output voltage is calculated according to the gain correction factor, and whether the gain of the amplifier needs to be adjusted is determined according to the output voltage difference. The gain of the amplifier is adjusted according to the determination result and a preset gain adjustment step.

[0088] The accuracy and precision of the correction is achieved by adjusting the gain of the amplifier to make the output voltage reach the second correction output voltage. The correction result can be accurately adjusted by gradually adjusting the gain of the amplifier according to the judgment of the output voltage difference. This ensures that the corrected output voltage more accurately reflects the measured signal characteristics, improving the accuracy and stability of the correction result.

[0089] The gain adjustment step is the amount of increase or decrease each time the amplifier gain is adjusted, and is used to control the accuracy and range of the gain adjustment. The setting of the gain adjustment step should comprehensively consider factors such as system requirements, correction targets, output accuracy requirements, adjustment time, and computational complexity. A smaller step can achieve more subtle adjustments, but may increase the computational burden and adjustment time. A larger step can reduce the computational burden and adjustment time, but may sacrifice some adjustment accuracy. Generally speaking, the gain adjustment step can be set in the range of 0.1% to 1%, and the specific value range needs to be determined according to the actual application requirements and equipment performance. If the correction accuracy requirements are high, a smaller step can be selected, such as 0.1%. For general requirements, a larger step such as 1% may be more appropriate. In this embodiment, the gain adjustment step is set to 1%.

[0090] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An electrical signal correction method for resistor sampling, characterized in that: include: Step S1, performing theoretical zero point correction on the output voltage of the circuit according to the measured output voltage of the circuit connected with the sampling resistor and the measured output voltage of the circuit when the sampling resistor is not connected, so as to obtain a first corrected output voltage, obtaining the difference between the output voltage of the circuit connected with the sampling resistor and the output voltage of the circuit to be corrected when the sampling resistor is not connected, and comparing the difference with a preset output voltage difference threshold, and judging whether the first corrected output voltage needs to be corrected by theoretical gain according to the comparison result; Step S2, for a first corrected output voltage that needs theoretical gain correction, connect a reference resistor of known resistance value to the circuit, measure the output voltage of the circuit after the reference resistor is connected, calculate a gain correction factor according to the first corrected output voltage and the measured output voltage of the circuit after the reference resistor is connected, and correct the first corrected output voltage according to the gain correction factor and the first corrected output voltage to obtain a second corrected output voltage; Step S3, connecting a reference resistor to the circuit, measuring the second corrected output voltage, calculating a relative error according to the first corrected output voltage and the second corrected output voltage, and determining whether the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction by comparing the relative error with a preset error threshold; Step S4, for the second calibrated output voltage that needs to adjust the zero point calibration and the gain calibration, determine the direction of the actual offset of the first calibrated output voltage according to the relative error, adjust the resistance value of the sampling resistor according to the direction of the actual offset, and measure the output voltage of the circuit connected with the sampling resistor after the adjustment resistor in real time until the output voltage measured in real time is equal to the first calibrated output voltage; Step S5, adjusting the gain of the amplifier in the circuit for amplifying the output voltage of the sampling resistor according to the gain correction factor and the first corrected output voltage, so that the output voltage reaches the second corrected output voltage.

2. The electrical signal correction method for resistor sampling according to claim 1, characterized in that: In step S1, the theoretical zero point correction is to subtract the output voltage of the circuit connected with the sampling resistor from the output voltage of the circuit when the sampling resistor is not connected to obtain the difference of the theoretical zero point correction, apply the difference of the theoretical zero point correction to the output voltage of the circuit, and calculate the sum of the output voltage of the circuit when the sampling resistor is not connected and the difference of the theoretical zero point correction to obtain a first corrected output voltage.

3. The electrical signal correction method for resistor sampling according to claim 2, characterized in that: In step S1, a preset output voltage difference threshold is set, and the difference of the theoretical zero point correction is compared with the output voltage difference threshold to determine whether the first corrected output voltage needs to be corrected by theoretical gain. If the difference of the theoretical zero point correction is less than or equal to the output voltage difference threshold, it is determined that a theoretical gain correction is required; If the difference of the theoretical zero point correction is greater than the output voltage difference threshold, it is determined that no theoretical gain correction is required.

4. The electrical signal correction method for resistor sampling according to claim 3, characterized in that: In the step S2, the gain correction factor is calculated by calculating the ratio of the first corrected output voltage to the measured output voltage of the circuit connected with the reference resistor.

5. The electrical signal correction method for resistor sampling according to claim 4, characterized in that: In the step S2, the first corrected output voltage is corrected according to the gain correction factor and the first corrected output voltage, and the gain correction factor is multiplied by the first corrected output voltage to obtain a second corrected output voltage.

6. The electrical signal correction method for resistor sampling according to claim 5, characterized in that: In step S3, the relative error is calculated based on the first corrected output voltage and the second corrected output voltage, and the relative error is obtained by taking the difference between the first corrected output voltage and the second corrected output voltage and taking the ratio of the difference between the first corrected output voltage and the second corrected output voltage to the first corrected output voltage.

7. The electrical signal correction method for resistor sampling according to claim 6, characterized in that: In step S3, a preset error threshold is set, and by comparing the relative error with the preset error threshold, it is determined whether the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction. If the relative error is greater than the error threshold, determining that the second calibrated output voltage needs to be subjected to actual zero point calibration and actual gain calibration; If the relative error is less than the error threshold, it is determined that the second corrected output voltage needs to be subjected to actual zero point correction and actual gain correction.

8. The electrical signal correction method for resistor sampling according to claim 7, characterized in that: In step S4, the direction of the actual offset of the first corrected output voltage is determined according to the relative error. If the relative error is greater than zero, it is determined that the direction of the actual offset of the first corrected output voltage is positive, and a negative offset adjustment is required; If the relative error is less than zero, it is determined that the direction of the actual offset of the first corrected output voltage is negative, and a positive offset adjustment is required.

9. The electrical signal correction method for resistor sampling according to claim 8, characterized in that: In step S4, a preset resistance adjustment step is set, and the resistance value of the sampling resistor is adjusted according to the direction of the actual offset and the resistance adjustment step. If the direction of the actual offset of the first calibrated output voltage is positive, reducing the resistance value of the sampling resistor according to a preset adjustment resistance value step; If the direction of the actual offset of the first calibrated output voltage is negative, the resistance value of the sampling resistor is increased according to a preset adjustment resistance value step.

10. The electrical signal correction method for resistor sampling according to claim 9, characterized in that: In step S5, adjusting the gain of an amplifier in the circuit for amplifying the output voltage of the sampling resistor according to the gain correction factor and the first corrected output voltage includes: The output voltage difference between the first corrected output voltage and the second corrected output voltage is calculated according to the gain correction factor, A=(BC)×D, wherein A is the output voltage difference, B is the second corrected output voltage, C is the first corrected output voltage, and D is the gain correction factor. The gain of the amplifier is determined according to the output voltage difference, and the gain of the amplifier is adjusted according to the determination result and a preset gain adjustment step. If the output voltage difference is greater than zero, it is determined that the gain of the amplifier needs to be increased and adjusted, and the gain of the amplifier is increased and adjusted according to the gain adjustment step; If the output voltage difference is less than zero, it is determined that the gain of the amplifier needs to be reduced and adjusted, and the gain of the amplifier is reduced and adjusted according to the gain adjustment step.