Voltage sampling circuit and sampling method
By combining the Hall effect current sensor and the digital signal processor, the problem of the voltage sampling circuit being affected by the environment is solved, and the safe and accurate measurement of high voltage is achieved, which reduces the cost and improves the reliability of voltage judgment.
Patent Information
- Application Number
- CN202510785798.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-12
AI Technical Summary
The voltage sampling circuit is easily affected by the environment, causing the sampling to deviate from the midpoint and affecting the accuracy of voltage judgment.
A Hall effect current sensor is used to convert the voltage to be sampled into a Hall effect current signal, and a controllable pulse width modulation voltage is generated through a digital signal processor. Combined with an operational amplifier and an analog-to-digital converter, safe and accurate voltage measurement is achieved.
It realizes the safe measurement of high voltage, reduces sampling cost, improves the stability and reliability of voltage sampling circuit, and ensures the accuracy of voltage judgment.
Smart Images

Figure CN120629702A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power grid technology, and in particular to a voltage sampling circuit and a sampling method. Background Art
[0002] In the power grid, the main function of voltage sampling circuits is to accurately measure and monitor voltage parameters in the power system. This data is crucial for ensuring the safe and stable operation of the power grid and optimizing power quality.
[0003] In related technologies, the voltage sampling circuit mainly uses the front-stage voltage divider resistor to reduce the high-voltage signal of the AC power to a low-voltage range suitable for subsequent sampling for sampling. However, due to environmental influences, the front-stage voltage divider resistor is prone to changes and the power supply signal is affected by the outside world. At this time, the AC voltage sampling is prone to deviate from the midpoint, affecting voltage sampling and subsequent voltage fault judgment. Summary of the Invention
[0004] The embodiments of the present application provide a voltage sampling circuit and a sampling method to solve the problem in the related art that the voltage sampling circuit is prone to sampling deviation from the midpoint, resulting in inaccurate voltage judgment.
[0005] In a first aspect, an embodiment of the present application provides a voltage sampling circuit, comprising:
[0006] Power supply circuit and sampling circuit;
[0007] The power supply circuit includes a digital signal processor and a differential circuit;
[0008] The digital signal processor includes an analog-to-digital converter input pin and a voltage signal output pin for outputting a pulse width modulated voltage;
[0009] The voltage signal output pin is connected to the differential circuit input terminal, and the differential circuit output terminal is connected to the sampling circuit;
[0010] The sampling circuit includes a Hall effect current sensor, the input end of the Hall effect current sensor is connected to the voltage to be sampled, the output end of the Hall effect current sensor is connected through the input end of the first operational amplifier, the output end of the first operational amplifier is connected to the output end of the power supply circuit, and the output end of the first operational amplifier is connected to the input pin of the analog-to-digital converter;
[0011] Among them, the digital signal processor includes an analog-to-digital converter, the digital signal processor is used to generate a pulse width modulated voltage signal with a set duty cycle and output it through the voltage signal input pin, and the differential circuit is used to convert the pulse width modulated voltage signal into a deflection voltage signal corresponding to the midpoint potential of the analog-to-digital converter; the Hall effect current sensor is used to convert the voltage signal to be sampled into a Hall effect current signal, and the first operational amplifier is used to convert the Hall effect current signal into a voltage signal to be measured corresponding to the range of the analog-to-digital converter, and the voltage signal to be measured and the set deflection voltage are input together into the analog-to-digital converter input pin corresponding to the analog-to-digital converter, and the analog-to-digital converter is used to identify the input voltage signal and determine the voltage to be sampled based on the identification result.
[0012] In one possible embodiment, a filter circuit is provided between the output end of the voltage signal output pin and the input end of the differential circuit, and the filter circuit includes a first resistor connected to the output end of the voltage signal output pin, wherein the filter circuit is used to convert the pulse width modulated voltage signal into a direct current signal.
[0013] In one possible embodiment, the differential circuit includes a second operational amplifier, the output end of the filter circuit is connected to the negative input end of the second operational amplifier via a second resistor, the positive input end of the second operational amplifier is connected to a DC power supply of a first set voltage via a third resistor, the output end of the second operational amplifier is connected to the output end of the first operational amplifier, and the second operational amplifier is used to amplify the DC signal into a deflection voltage signal corresponding to the midpoint potential of the analog-to-digital converter.
[0014] In a possible implementation, the output terminal of the second operational amplifier is connected to the negative input terminal of the second operational amplifier via a fourth resistor; and the positive input terminal of the second operational amplifier is grounded via a fifth resistor.
[0015] In one possible embodiment, the power input terminal of the Hall effect current sensor is connected to the positive and negative power supplies of the second set voltage, the positive voltage input terminal of the Hall effect current sensor is connected to the voltage to be sampled through a sixth resistor, and the negative voltage input terminal of the Hall effect current sensor is connected to the voltage to be sampled through a seventh resistor.
[0016] In a possible implementation, the positive input terminal of the first operational amplifier is grounded via an eighth resistor; the negative input terminal of the first operational amplifier is connected to the output terminal of the first operational amplifier via a ninth resistor.
[0017] In a possible implementation, a tenth resistor is provided between the output end of the first operational amplifier and the input pin of the analog-to-digital converter; and an eleventh resistor is provided between the output end of the second operational amplifier and the input pin of the analog-to-digital converter.
[0018] In a second aspect, an embodiment of the present application provides a voltage sampling method, which is applied to the voltage sampling circuit of the first aspect and / or various possible implementations of the first aspect. The voltage sampling method includes:
[0019] Based on the set duty cycle, a pulse width modulated voltage is output from a voltage signal output pin of the digital signal processor;
[0020] Based on the input end of the Hall effect current sensor, a voltage to be sampled is obtained;
[0021] Determining a corresponding input digital voltage based on a voltage inputted at an analog-to-digital converter input pin of a digital signal processor;
[0022] Based on the corresponding relationship between the input digital voltage and the voltage to be sampled, the value of the voltage to be sampled is determined.
[0023] In a possible implementation, if the voltage to be sampled is an AC voltage, the calculation formula for setting the duty cycle is:
[0024] ,
[0025] Among them, K1 is the set duty cycle, R2 is the resistance value of the second resistor, and R4 is the resistance value of the fourth resistor; if the voltage to be sampled is a DC voltage, the duty cycle is set to 1.
[0026] In a possible implementation, the corresponding relationship between the input digital voltage and the voltage to be sampled includes:
[0027] ,
[0028] Among them, U_adc is the measured value corresponding to the voltage to be sampled, UADCin is the input digital voltage corresponding to the input voltage value, U_REF is the voltage value output by the power supply circuit, U3 is used to represent the voltage at the output end of the first operational amplifier, U2 is used to represent the voltage at the output end of the Hall effect current sensor, U1 is used to represent the voltage at the output end of the filter circuit, 3V is the value of the first set voltage, UAB is the voltage to be sampled, R6 is the resistance value of the sixth resistor, R7 is the resistance value of the seventh resistor, R8 is the resistance value of the eighth resistor, and K2 is the conversion ratio of the Hall effect current sensor.
[0029] The voltage sampling circuit and sampling method provided in the embodiments of the present application convert the direct measurement of the voltage to be sampled into the measurement of the magnetic field of the voltage to be sampled, thereby achieving indirect measurement of the voltage to be sampled and utilizing its electrical isolation characteristics to achieve safe measurement of high voltage. A power supply circuit is provided, and a digital signal processor cooperates with a differential circuit to generate a controllable pulse-width modulated voltage through the digital signal processor. The pulse-width modulated voltage raises the voltage output by the Hall-effect current sensor, thereby ensuring that the voltage received by the analog-to-digital converter input pin is a positive voltage. In this case, the digital signal sensor only needs to use a single analog-to-digital converter polarity, resulting in a simpler structure and lower procurement cost. At the same time, when the voltage to be sampled is an AC voltage, the sampling midpoint potential can be controlled by adjusting the pulse-width modulated voltage without being affected by the environment, thereby ensuring the stability and reliability of the voltage sampling circuit and the accuracy of the voltage judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0031] Figure 1 A schematic diagram of a voltage sampling structure in the prior art provided by an embodiment of the present disclosure;
[0032] Figure 2 A schematic diagram of the structure of a voltage sampling circuit provided in one embodiment of the present disclosure;
[0033] Figure 3 This is a flowchart of a sampling method of a voltage sampling circuit provided by yet another embodiment of the present disclosure.
[0034] Among them, 100 is the front-stage voltage divider resistor, 110 is the measuring element;
[0035] 200. Voltage sampling circuit, 210. Power supply circuit, 211. Digital signal processor, 212. Analog-to-digital converter input pin, 213. Voltage signal output pin, 214. Filter circuit, 220. Differential circuit, 221. DC power supply, 230. Sampling circuit, 231. Hall effect current sensor, 232. Positive and negative power supply.
[0036] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0037] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0038] In the power grid, voltage is one of the most fundamental and important parameters in the power system. It directly impacts the normal operation of power equipment and the safety of electricity users. In practical applications, accurate voltage measurement is crucial to ensuring the stable operation of the power system. Therefore, a large number of voltage sampling circuits are installed in the power grid to accurately measure and monitor voltage parameters in the power system. This data is crucial for ensuring the safe and stable operation of the power grid and optimizing power quality.
[0039] In related technologies, the voltage sampling circuit mainly uses the front-stage voltage-divider resistor to reduce the high-voltage signal of the AC power to a low-voltage range suitable for subsequent sampling for sampling. However, due to environmental influences, such as temperature and humidity changes, the physical structure of the front-stage voltage-divider resistor is affected by the environment, or the power supply signal is affected by the outside world, resulting in changes in the front-stage voltage-divider resistor and the power supply signal being affected by the outside world. At this time, it is easy for the AC voltage sampling to deviate from the midpoint, affecting the voltage sampling and subsequent voltage fault judgment.
[0040] Figure 1 This is a schematic diagram of the structure of the voltage sampling circuit in the prior art provided by this application, such as Figure 1 As shown, in the voltage sampling circuit in the prior art, the voltage to be sampled U is divided by the front-stage voltage-dividing resistor 100 and then measured by the measuring element 110 .
[0041] It should be noted that Figure 1 The scenario shown includes a front-stage voltage divider resistor and a measuring element, and only one or a specific number of them are used as examples for illustration, and to simplify the display, they are only marked in series, but the present disclosure is not limited to this. That is, the number of front-stage voltage divider resistors and measuring elements, and their measurement methods can be arbitrary.
[0042] The voltage sampling circuit provided in this application generates a stable and controllable deflection voltage through a power supply circuit including a digital signal processor, and then converts the voltage to be sampled into a safe measurement voltage with a smaller variation range through a Hall effect current sensor. The voltage value is then measured through the input pin of the analog-to-digital converter to ensure the accuracy, stability and reliability of the final measurement result.
[0043] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0044] Figure 2 The schematic diagram of the voltage sampling circuit provided in this application is as follows: Figure 2 As shown, the structure includes:
[0045] Power supply circuit 210 and sampling circuit 230;
[0046] The power supply circuit 210 includes a digital signal processor 211 and a differential circuit 220;
[0047] The digital signal processor 211 includes an analog-to-digital converter input pin 212 and a voltage signal output pin 213 for outputting a pulse width modulated voltage;
[0048] The voltage signal output pin 213 is connected to the input end of the differential circuit 220 , and the output end of the differential circuit 220 is connected to the sampling circuit 230 ;
[0049] The sampling circuit 230 includes a Hall effect current sensor 231, the input end of the Hall effect current sensor 231 is connected to the voltage to be sampled, the output end of the Hall effect current sensor 231 is connected through the input end of the first operational amplifier, the output end of the first operational amplifier is connected to the output end of the power supply circuit 210, and the output end of the first operational amplifier is connected to the analog-to-digital converter input pin 212.
[0050] Among them, the digital signal processor 211 includes an analog-to-digital converter, which is used to generate a pulse-width modulated voltage signal with a set duty cycle and output it through the voltage signal input pin 213. The differential circuit 220 is used to convert the pulse-width modulated voltage signal into a deflection voltage signal corresponding to the midpoint potential of the analog-to-digital converter; the Hall-effect current sensor 231 is used to convert the voltage signal to be sampled into a Hall-effect current signal, and the first operational amplifier is used to convert the Hall-effect current signal into a voltage signal to be measured corresponding to the range of the analog-to-digital converter, and input the voltage signal to be measured and the set deflection voltage together into the analog-to-digital converter input pin 212 corresponding to the analog-to-digital converter. The analog-to-digital converter is used to identify the input voltage signal and determine the voltage to be sampled based on the identification result.
[0051] Specifically, this embodiment is used to generally describe the main structure and principle of voltage sampling by a voltage sampling circuit.
[0052] The voltage sampling circuit provided in this embodiment can be applied to various devices that need to sample grid voltage (that is, any location where voltage measurement is required). For example, when voltage sampling of input current is required in a substation or transformer, a voltage sampling circuit can be deployed. For example, when a user-side energy storage cabinet receives current input from the grid, sampling can be performed through a voltage sampling circuit to quickly and accurately obtain its specific voltage value.
[0053] Because the voltage range to be sampled may vary, such as high voltage, low voltage, direct current, alternating current, etc., a Hall-effect current sensor 231 is connected to the sampling point of the voltage to be sampled. This allows the Hall current generated when the electrical signal to be sampled is applied to the Hall-effect current sensor 231 to be measured, replacing the direct measurement of the voltage to be sampled. Because the proportional relationship between the voltage to be sampled and the corresponding Hall current can be adjusted by configuring the Hall-effect current sensor 231, the user can adjust the parameters of the Hall-effect current sensor 231 based on the estimated value range of the voltage to be sampled, converting the voltage to be sampled into a value range that can be processed by the voltage sampling circuit (e.g., -1.5V to 1.5V, 0V to 5V, etc.), enabling accurate measurement by the voltage sampling circuit.
[0054] At the same time, the Hall effect current sensor 231 can be used to achieve the characteristic of electrical isolation (that is, the electrical signal of the subsequent component at the input end comes from the magnetic field generated by the electrical signal to be sampled, rather than the signal at the point to be sampled itself, and the electrical signal to be sampled itself will not flow into the subsequent component, thereby achieving electrical isolation), effectively ensuring the safe measurement of high-voltage signals, avoiding impact on the voltage sampling circuit, and thus improving the safety and applicability of the voltage sampling circuit.
[0055] During the voltage sampling process, in order to avoid the possible interference of noise signals such as common-mode noise on the sampling results, it is necessary to determine the voltage midpoint of the voltage to be sampled. Using the voltage midpoint as a reference point, the voltage values of the voltage to be sampled at different times are measured. By determining the voltage midpoint, the deviation of the voltage to be sampled relative to the voltage midpoint is determined, and its specific voltage value is calculated more accurately.
[0056] For direct current, the midpoint of the voltage is positive, but for alternating current, the midpoint may be zero. Direct measurement requires a power supply that includes both positive and negative power supplies, and an analog-to-digital converter (in this solution, the analog-to-digital converter is built into digital signal processor 211, and the acquired electrical signal is input to the analog-to-digital converter for processing via analog-to-digital converter input pin 212) capable of processing both positive and negative voltages, which is costly. Therefore, in this solution, a deflection voltage is applied to the voltage output by Hall-effect current sensor 231, placing its midpoint at the middle of the analog-to-digital converter's range. This ensures the converter's measurement resolution and, consequently, measurement accuracy.
[0057] Furthermore, the deflection voltage is generated by the power supply circuit 210, and the current signal generated by the voltage signal output pin 213 of the digital signal processor 211 is amplified to the middle value of the range of the analog-to-digital converter (such as 1.5V, 5V) through the differential circuit 220, and then output from the differential circuit 220 to obtain the deflection voltage corresponding to the range of the analog-to-digital converter.
[0058] On this basis, since the electrical signal output by the Hall effect current sensor 231 may not meet the range of the analog-to-digital converter, it is necessary to connect a first operational amplifier to the output end of the Hall effect current sensor 231 to amplify the current through the first operational amplifier so that its corresponding voltage range corresponds to the range of the analog-to-digital converter (or is slightly smaller than the range of the analog-to-digital converter) to facilitate measurement.
[0059] The output result of the first operational amplifier and the output end of the differential circuit 220 are both connected to the analog-to-digital converter input pin 212, so that the voltage of the input signal can be measured by the analog-to-digital converter and converted into a numerical value, and then the specific value of the voltage to be sampled can be converted.
[0060] The voltage sampling circuit provided in the embodiment of the present application converts the direct measurement of the voltage to be sampled into the measurement of the magnetic field of the voltage to be sampled, thereby achieving indirect measurement of the voltage to be sampled, and utilizing its electrical isolation characteristics to achieve safe measurement of high voltage. A power supply circuit is provided, and a digital signal processor cooperates with a differential circuit to generate a controllable pulse width modulation voltage through the digital signal processor, so that the pulse width modulation voltage raises the voltage output by the Hall effect current sensor, so that the voltage received by the analog-to-digital converter input pin is a positive voltage. In this case, the digital signal sensor only needs to use a single analog-to-digital converter polarity, which has a simpler structure and lower procurement cost. At the same time, when the voltage to be sampled is an AC voltage, the sampling midpoint potential can be controlled by adjusting the pulse width modulation voltage without being affected by the environment, thereby ensuring the stability and reliability of the voltage sampling circuit and the accuracy of the voltage judgment.
[0061] Recombination Figure 2 Based on the above embodiment, this embodiment further describes the structure of the voltage sampling circuit in detail. The circuit further includes:
[0062] A filter circuit 214 is provided between the output end of the voltage signal output pin 213 and the input end of the differential circuit 220. The filter circuit 214 includes a first resistor R1 connected to the output end of the voltage signal output pin 213. The filter circuit 214 is used to convert the pulse width modulated voltage signal into a direct current signal.
[0063] Specifically, the electrical signal output by the voltage signal output pin 213 (i.e., ecap in the figure) is a PWM electrical signal (i.e., a pulse width modulation signal), which includes a high level and a low level. By providing a filter circuit 214 between the output end of the voltage signal output pin 213 and the input end of the differential circuit 220, the PWM electrical signal is deflected and converted into a DC signal corresponding to the PWM average voltage value through processing by the filter circuit 214, thereby ensuring the stability of the output deflection voltage.
[0064] Specifically, the value of the electrical signal output by the filter circuit 214 can be achieved by controlling the duty cycle of the PWM voltage. The higher the duty cycle (ie, the higher the proportion of the high level), the higher the voltage value output by the filter circuit 214.
[0065] In one possible embodiment, the differential circuit 220 includes a second operational amplifier, the output end of the filter circuit 214 is connected to the negative input end of the second operational amplifier through a second resistor R2, the positive input end of the second operational amplifier is connected to a DC power supply 221 with a first set voltage through a third resistor R3, and the output end of the second operational amplifier is connected to the output end of the first operational amplifier. The second operational amplifier is used to amplify the DC signal into a deflection voltage signal corresponding to the midpoint potential of the analog-to-digital converter.
[0066] Specifically, the deflection voltage corresponding to the midpoint of the analog-to-digital converter range can be obtained by amplifying the DC voltage output by the corresponding filter circuit 214 through the second operational amplifier (ie, M1D in the figure).
[0067] In a possible implementation, the output terminal of the second operational amplifier is connected to the negative input terminal of the second operational amplifier via a fourth resistor R4; the positive input terminal of the second operational amplifier is grounded via a fifth resistor R5.
[0068] Specifically, by indirectly connecting the fourth resistor R4 between the output end of the second operational amplifier and the negative input end, and connecting the second resistor and the filter circuit 214 in series through the negative input end, the amplification value of the output voltage of the filter circuit 214 by the differential circuit 220 can be controlled by configuring the resistance values of the second resistor R2 and the fourth resistor R4.
[0069] By grounding the positive input terminal of the second operational amplifier and connecting it to the DC power supply 221 (the DC power supply 221 may be 3V), the stability of the process of amplifying the output voltage of the filter circuit by the differential circuit 220 can be ensured.
[0070] In one possible embodiment, the power input terminal of the Hall effect current sensor 231 is connected to the positive and negative power supplies of the second set voltage, the positive voltage input terminal of the Hall effect current sensor 231 is connected to the voltage to be sampled through a sixth resistor, and the negative voltage input terminal of the Hall effect current sensor 231 is connected to the voltage to be sampled through a seventh resistor.
[0071] Specifically, to ensure the normal operation of the Hall effect current sensor 231, it is necessary to provide it with a positive and negative power supply 232, the specific value of which (i.e., the second set voltage) can be determined according to the configuration parameters of the Hall effect current sensor 231.
[0072] The input terminals of the Hall effect current sensor 231 (i.e., +HT and −HT in the figure) are connected to one end of the voltage to be sampled (i.e., UA and UB in the figure) through the sixth resistor R6 and the seventh resistor R7, respectively, so that the voltage to be sampled is input into the Hall effect current sensor 231.
[0073] In a possible implementation, the positive input terminal of the first operational amplifier is grounded via an eighth resistor R8 ; the negative input terminal of the first operational amplifier is connected to the output terminal of the first operational amplifier via a ninth resistor R9 .
[0074] Specifically, the negative input terminal and the output terminal of the first operational amplifier (i.e., U1A in the figure) are connected through the ninth resistor R9, and the Hall current ( Figure 2 Where M is the output terminal of the Hall effect current sensor 231), thereby forming a non-inverting proportional amplifier, which can be used to amplify the input Hall current and ensure the stability of the Hall current and improve its driving ability.
[0075] By grounding the positive input terminal of the first operational amplifier through the eighth resistor R8, charge accumulation in the first operational amplifier is prevented, which causes a DC offset or drift in the voltage outputted by the output terminal, thereby ensuring the stability of the measurement result.
[0076] In a possible implementation, a tenth resistor R10 is provided between the output end of the first operational amplifier and the analog-to-digital converter input pin 212 ; an eleventh resistor R11 is provided between the output end of the second operational amplifier and the analog-to-digital converter input pin 212 .
[0077] Specifically, through the cooperation of the tenth resistor R10 and the eleventh resistor R11, the voltage output by the power supply circuit 210 and the voltage output by the sampling circuit 230 are stabilized, so that the voltage input to the analog-to-digital converter input pin 212 is the average of the voltage output by the power supply circuit 210 and the voltage output by the sampling circuit 230, so that the analog-to-digital converter can perform measurement.
[0078] The result of the analog-to-digital converter measurement can be quickly and easily converted to the accurate value of the voltage to be sampled through calculation by the digital signal processor, thereby ensuring the accuracy of the measurement.
[0079] The voltage sampling circuit provided in the embodiment of the present application outputs a pulse width modulated voltage through a voltage signal output pin, and is processed by a filtering circuit to obtain a stable DC voltage, which is then amplified by a differential circuit to obtain a deflection voltage. The voltage to be sampled is collected by a Hall effect current sensor and converted into a Hall current. After being processed by a first operational amplifier, it is combined with the deflection voltage to obtain a voltage input to the input pin of an analog-to-digital converter. The specific value of the voltage to be sampled can be accurately obtained through measurement by the analog-to-digital converter and calculation by a digital signal processor.
[0080] Figure 3 The voltage sampling process provided for this application is shown in FIG. Figure 1 ,like Figure 3 As shown, this embodiment, based on the above embodiments, describes in detail the process of calculating the voltage value to be sampled based on the voltage sampling circuit. The method is applied to the voltage sampling circuit in any of the above embodiments, and includes:
[0081] S301 : Outputting a pulse width modulated voltage from a voltage signal output pin of a digital signal processor based on a set duty cycle.
[0082] Specifically, the electrical signal outputted by the voltage signal output pin of the digital signal processor is a pulse width modulated voltage with a set duty cycle. The set duty cycle can be calculated in different ways depending on whether the voltage to be sampled is DC or AC.
[0083] Furthermore, the voltage to be sampled is an AC voltage, and the calculation formula for setting the duty cycle is:
[0084] ,
[0085] Wherein, K1 is the set duty cycle, R2 is the resistance value of the second resistor, and R4 is the resistance value of the fourth resistor; and if the voltage to be sampled is a DC voltage, the duty cycle is set to 1.
[0086] Specifically, for DC voltage, the duty cycle is directly set to 1. At this time, the second resistor can be eliminated, so that the voltage value output by the filter circuit is higher, and the obtained deflection voltage value is higher, so that the voltage to be sampled with a higher voltage midpoint value can be measured, thereby making the measurement range of the voltage sampling circuit wider.
[0087] If the voltage to be sampled is an AC voltage, the duty cycle value can be controlled, and thus the corresponding deflection voltage value can be controlled to be as close as possible to the midpoint of the analog-to-digital converter's range to ensure measurement accuracy.
[0088] S302 : Obtain a voltage to be sampled based on an input end of the Hall effect current sensor.
[0089] Specifically, it can be seen from the above embodiments that the voltage to be sampled can be obtained through the Hall effect current sensor.
[0090] S303 : Determine a corresponding input digital voltage based on a voltage inputted from an analog-to-digital converter input pin of a digital signal processor.
[0091] Specifically, the voltage signal output by the voltage sampling circuit can be collected through the analog-to-digital converter input pin in the digital signal processor and converted into a corresponding numerical value (ie, input digital voltage).
[0092] Therefore, the generation of the deflection voltage and the measurement of the voltage value can be completed through a digital signal processor, which saves costs and ensures the accuracy of the measurement.
[0093] S304 : Determine a value of the voltage to be sampled based on the corresponding relationship between the input digital voltage and the voltage to be sampled.
[0094] Specifically, based on the calculated voltage value, the accurate value of the voltage to be sampled can be converted.
[0095] Furthermore, the corresponding relationship between the input digital voltage and the voltage to be sampled includes:
[0096] ,
[0097] Among them, U_adc is the measured value corresponding to the voltage to be sampled, UADCin is the input digital voltage corresponding to the input voltage value, U_REF is the voltage value output by the power supply circuit, U3 is used to represent the voltage at the output end of the first operational amplifier, U2 is used to represent the voltage at the output end of the Hall effect current sensor, U1 is used to represent the voltage at the output end of the filter circuit, U0 is the output voltage of the voltage signal output pin, UAB is the voltage to be sampled, R6 is the resistance value of the sixth resistor, R7 is the resistance value of the seventh resistor, R8 is the resistance value of the eighth resistor, and K2 is the conversion ratio of the Hall effect current sensor.
[0098] Specifically, the above formula can be used to quickly calculate the voltage to be sampled corresponding to the input digital voltage. The principle is explained below:
[0099] The high level of the PWM voltage output from the voltage signal output pin is U0, and the low level is 0. The corresponding set duty cycle is K1. After processing by the filter circuit, the corresponding output voltage U1 can be obtained, that is:
[0100] U1=U0*K1,
[0101] The output voltage U1 of the filter circuit is then amplified by the differential circuit to obtain the corresponding deflection voltage U_REF, that is:
[0102] ,
[0103] Among them, R2 and R4 are the resistance values of the second resistor and the fourth resistor respectively, 3V is the voltage value of the DC power supply of the first set voltage, and other resistance values can also be selected according to actual conditions, and the calculation principle is the same.
[0104] The circuit to be sampled is input to the Hall effect current sensor through the sixth and seventh resistors, and then through the output end of the Hall effect current sensor (connected to the grounded eighth resistor). Its output voltage is U2, which satisfies:
[0105] ,
[0106] After being processed by the first operational amplifier, U3 is obtained. In this solution, the first operational amplifier is configured as a non-inverting proportional amplifier, which mainly stabilizes the Hall current and improves its driving capability to ensure the accuracy of the measurement, but does not perform voltage amplification. Therefore, U3=U2.
[0107] The voltage that finally enters the input pin of the analog-to-digital converter is UADCin, which is the average of the voltages output by the sampling circuit and the power supply circuit. The analog-to-digital converter in the embodiment of the present disclosure is 16 bits, and its internal digital value 4096 corresponds to the analog voltage 3V. Therefore, the voltage conversion formula can be obtained:
[0108] ;
[0109] In this way, the accurate value of the voltage to be sampled can be quickly converted to ensure the accuracy of the measurement.
[0110] The sampling method of the voltage sampling circuit provided in the embodiment of the present application generates a pulse width modulation signal through a digital signal processor, processes it through a filtering circuit and a differential circuit, and then combines it with the voltage to be sampled after being processed by a sampling circuit including a Hall effect current sensor. The signal is then input into the digital signal processor for processing, thereby facilitating and accurately calculating the corresponding voltage value to be sampled.
[0111] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0112] Finally, it should be noted that those skilled in the art will readily identify other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely by the appended claims.
Claims
1. A voltage sampling circuit, characterized in that: include: Power supply circuit and sampling circuit; The power supply circuit includes a digital signal processor and a differential circuit; The digital signal processor includes an analog-to-digital converter input pin and a voltage signal output pin for outputting a pulse width modulated voltage; The voltage signal output pin is connected to the differential circuit input end, and the differential circuit output end is connected to the sampling circuit; The sampling circuit includes a Hall effect current sensor, the input end of the Hall effect current sensor is connected to the voltage to be sampled, the output end of the Hall effect current sensor is connected to the input end of a first operational amplifier, the output end of the first operational amplifier is connected to the output end of the power supply circuit, and the output end of the first operational amplifier is connected to the input pin of the analog-to-digital converter; In which, the digital signal processor includes an analog-to-digital converter, the digital signal processor is used to generate a pulse width modulated voltage signal with a set duty cycle and output it through the voltage signal input pin, the differential circuit is used to convert the pulse width modulated voltage signal into a deflection voltage signal corresponding to the midpoint potential of the analog-to-digital converter; the Hall effect current sensor is used to convert the voltage signal to be sampled into a Hall effect current signal, the first operational amplifier is used to convert the Hall effect current signal into a voltage signal to be measured corresponding to the range of the analog-to-digital converter, and the voltage signal to be measured and the set deflection voltage are input together into the analog-to-digital converter input pin corresponding to the analog-to-digital converter, the analog-to-digital converter is used to identify the input voltage signal and determine the voltage to be sampled based on the identification result.
2. The voltage sampling circuit according to claim 1, wherein: A filter circuit is provided between the output end of the voltage signal output pin and the input end of the differential circuit, wherein the filter circuit includes a first resistor connected to the output end of the voltage signal output pin, wherein the filter circuit is used to convert the pulse width modulated voltage signal into a direct current signal.
3. The voltage sampling circuit according to claim 2, characterized in that: The differential circuit includes a second operational amplifier, The output end of the filter circuit is connected to the negative input end of the second operational amplifier via a second resistor, the positive input end of the second operational amplifier is connected to a DC power supply of a first set voltage via a third resistor, and the output end of the second operational amplifier is connected to the output end of the first operational amplifier. The second operational amplifier is used to amplify the DC signal into a deflection voltage signal corresponding to the midpoint potential of the analog-to-digital converter.
4. The voltage sampling circuit according to claim 3, characterized in that: The output terminal of the second operational amplifier is connected to the negative input terminal of the second operational amplifier via a fourth resistor; the positive input terminal of the second operational amplifier is grounded via a fifth resistor.
5. The voltage sampling circuit according to any one of claims 1 to 4, characterized in that: The power input terminal of the Hall effect current sensor is connected to the positive and negative power supplies of the second set voltage, the positive voltage input terminal of the Hall effect current sensor is connected to the voltage to be sampled through the sixth resistor, and the negative voltage input terminal of the Hall effect current sensor is connected to the voltage to be sampled through the seventh resistor.
6. The voltage sampling circuit according to claim 5, characterized in that: The positive input terminal of the first operational amplifier is grounded via an eighth resistor; The negative input terminal of the first operational amplifier is connected to the output terminal of the first operational amplifier via a ninth resistor.
7. The voltage sampling circuit according to claim 6, characterized in that: A tenth resistor is provided between the output end of the first operational amplifier and the input pin of the analog-to-digital converter; and an eleventh resistor is provided between the output end of the second operational amplifier and the input pin of the analog-to-digital converter.
8. A voltage sampling method, applied to the voltage sampling circuit according to any one of claims 1 to 7, characterized in that: include: Based on the set duty cycle, a pulse width modulated voltage is output from a voltage signal output pin of the digital signal processor; Based on the input end of the Hall effect current sensor, a voltage to be sampled is obtained; Determining a corresponding input digital voltage based on a voltage inputted by an analog-to-digital converter input pin of the digital signal processor; Based on the corresponding relationship between the input digital voltage and the voltage to be sampled, a value of the voltage to be sampled is determined.
9. The method according to claim 8, characterized in that If the voltage to be sampled is an AC voltage, the calculation formula for setting the duty cycle is: , Wherein, K1 is the set duty cycle, R2 is the resistance value of the second resistor, and R4 is the resistance value of the fourth resistor; If the voltage to be sampled is a DC voltage, the set duty cycle is 1.
10. The method according to claim 9, characterized in that The corresponding relationship between the input digital voltage and the voltage to be sampled includes: , Among them, U_adc is the measured value corresponding to the voltage to be sampled, UADCin is the input digital voltage corresponding to the input voltage value, U_REF is the voltage value output by the power supply circuit, U3 is used to represent the voltage at the output end of the first operational amplifier, U2 is used to represent the voltage at the output end of the Hall effect current sensor, U1 is used to represent the voltage at the output end of the filter circuit, U0 is the output voltage of the voltage signal output pin, UAB is the voltage to be sampled, R6 is the resistance value of the sixth resistor, R7 is the resistance value of the seventh resistor, R8 is the resistance value of the eighth resistor, and K2 is the conversion ratio of the Hall effect current sensor.