A method for calculating direct current of power supply and a monitoring system
By combining software and hardware methods, the zero-point drift error and electrical offset error of the DC current sensor are eliminated, the accuracy of current measurement is improved, and the problem of limited accuracy in the prior art is solved.
Patent Information
- Application Number
- CN202210559266.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-23
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-05-23
AI Technical Summary
In the prior art, only the zero-point drift error of the DC current sensor is eliminated through software or hardware, and other errors such as electrical offset errors cannot be eliminated, affecting the accuracy.
Using a combination of software and hardware, the current value is calculated by obtaining the actual voltage value collected by the analog-to-digital converter, the current transformer reference voltage, the analog-to-digital converter input range gain and current amplification factor, thereby eliminating the zero-point drift error and electrical offset error.
By eliminating zero-point drift error and electrical offset error, the accuracy of current measurement is improved, and the problem of limited accuracy in the prior art is solved.
Smart Images

Figure CN114966456B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of power supply current monitoring, and in particular relates to a power supply direct current calculation method and a monitoring system. Background Art
[0002] Current DC monitoring technology mainly relies on current sensors for measurement, most commonly Hall sensors. When measuring current values, there is usually zero drift and electrical offset error, which affects the accuracy. Generally, zero drift can be eliminated through software or hardware, but other errors cannot be eliminated through hardware.
[0003] In the prior art, patent CN112737295A uses software to eliminate zero drift, determines the corrected bias value of the current sensor according to the working state of the current sensor, calculates the sum of the corrected bias value and the initial bias value of the current sensor, and uses the working bias value of the current sensor as the working bias value of the current sensor. According to the working bias value of the current sensor and the pre-acquired initial current value, the sampling value of the current sensor is calculated, and the correction is performed directly on the basis of the initial current value. Patent CN108680885A uses hardware to eliminate zero drift. The Hall current sensor collects the switch action current value in real time, and the Hall current sensor is automatically zeroed through the zeroing module. The disadvantages of the prior art are: only the zero drift error is eliminated by software or hardware, and other errors cannot be eliminated, which affects the accuracy. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a power supply DC current calculation method and monitoring system to solve the problem in the prior art that only zero drift error is eliminated by software or hardware, while other errors cannot be eliminated, thus affecting the accuracy.
[0005] To achieve the above objectives, the present invention adopts the following technical solutions:
[0006] The present invention proposes a method for calculating a direct current of a power supply, the method comprising:
[0007] Get the actual voltage value D collected by the analog-to-digital converter and the current transformer reference voltage V ref , analog-to-digital converter input range gain Beta and current amplification factor Mult;
[0008] According to the actual voltage value D collected by the analog-to-digital converter and the current transformer reference voltage V ref , the analog-to-digital converter input range gain Beta and the current amplification factor Mult calculate the current I.
[0009] The actual voltage value D collected by the analog-to-digital converter and the current transformer reference voltage V ref, the analog-to-digital converter input range gain Beta and the current amplification factor Mult calculate the current value I, including
[0010] The step of obtaining the actual voltage value D collected by the analog-to-digital converter comprises:
[0011] When the power is turned on and initialized, the analog-to-digital converter collects the voltage value D0;
[0012] After the power-on initialization is completed, the analog-to-digital converter collects the voltage value D t ;
[0013] According to the collected voltage value D0 and the collected voltage value D t Calculate the voltage value D actually collected by the analog-to-digital converter.
[0014] According to the collected voltage value D0, the collected voltage value D t Calculate the voltage value D, including: D = D t -D0.
[0015] The collected voltage value D0 is the sum of the current transformer reference voltage and the current transformer zero drift. At this time, the external load is 0, D0 = φ × (V ref +V oe ),
[0016] Where V ref1 is the analog-to-digital converter reference voltage, V oe is the current transformer zero drift, V ref is the current transformer reference voltage and Beta is the analog-to-digital converter input range gain.
[0017] The current transformer reference voltage V ref =2.5±0.025V.
[0018] The current transformer zero drift V oe =±10mV.
[0019] The power supply is an AC-to-DC power supply with a DC current monitoring range of 0-40A, which is used to monitor the voltage and current information of the power supply. The power supply supplies power to the external load and the internal monitoring module at the same time.
[0020] When the power is initialized, if the power supply is in the calibration mode, software calibration is performed to eliminate the error of the current transformer. When performing the software calibration, the current line to be monitored is first unplugged from the current transformer to ensure that the current transformer is in an absolute no-load state during the software calibration.
[0021] The present invention also proposes a power supply DC current monitoring system, the system comprising:
[0022] The power supply unit is used to provide external power supply current to the external load and to provide the internal monitoring module monitoring circuit with the power supply current it needs;
[0023] A current transformer, used for contactlessly collecting the current provided by the power supply unit to the external load and the current provided by the internal monitoring module;
[0024] An analog-to-digital converter, used for receiving and converting the data collected by the current transformer, and transmitting the processed data to the CPU;
[0025] The CPU is used to receive and process the data output by the analog-to-digital converter and execute the power supply DC current calculation method.
[0026] The technical solution proposed in the present invention eliminates the zero drift error and electrical offset error by combining software and hardware, thereby ensuring accuracy, thereby solving the problem in the prior art that only the zero drift error is eliminated by software or hardware, while other errors cannot be eliminated, thus affecting accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1 A schematic diagram of a power supply DC current monitoring system according to an embodiment of the present invention is shown;
[0029] Figure 2 A flow chart of a method for calculating direct current of a power supply according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] like Figure 1The figure shows a schematic diagram of a power supply DC current monitoring system according to an embodiment of the present invention. The power supply DC current monitoring system comprises:
[0032] The power supply unit is used to provide external power supply current to the external load and to provide the internal monitoring module monitoring circuit with the power supply current it needs;
[0033] A current transformer, used for contactlessly collecting the current provided by the power supply unit to the external load and the current provided by the internal monitoring module;
[0034] An analog-to-digital converter, used for receiving and converting the data collected by the current transformer, and transmitting the processed data to the CPU;
[0035] The CPU is used for receiving and processing the data output by the analog-to-digital converter and executing the power supply DC current calculation method.
[0036] In this embodiment, the power supply unit is an IPU-II power supply, which is an AC220V to DC24V power supply. The current transformer measurement range is I range =0-20A, reference voltage V ref , V ref =2.5±0.025V, current transformer zero drift V oe = ±10mV, current transformer gain G th =800mV / I pn =32mV / A, zero output voltage V out =V ref +V oe The voltage and current information of the IPU-II power supply can be monitored. The DC current monitoring range is 0-40A, and the required accuracy is 1%.
[0037] In this embodiment, the CPU is Cortex-M4 (STM32F407).
[0038] In this embodiment, the software is an RT-thread embedded real-time operating system.
[0039] In this embodiment, the current transformer is HO 25-P model, and the effective current value I is measured. pn =25A, the measurable current range is I pm = ±62.5V, the current transformer HO 25-P mainly has two errors, zero drift and electrical offset error.
[0040] In this embodiment, the analog-to-digital converter is an AD acquisition chip, and the ADS8688 model is selected, a 16-bit analog-to-digital converter (ADC), and the analog-to-digital converter input reference voltage is V ref1=4.096V, the input range gain is Beta=1.25 times, and the voltage value collected by the analog-to-digital converter after power-on initialization is D t .
[0041] The power supply DC current monitoring system of the present invention first obtains the actual voltage value D and the reference voltage V collected by the analog-to-digital converter. ref , analog-to-digital converter input range gain Beta, current amplification factor Mult; then calculate the current I based on the above data; thereby eliminating the zero drift error and electrical offset error through a combination of software and hardware, ensuring accuracy, and solving the problem in the prior art that only the zero drift error is eliminated through software or hardware, and other errors cannot be eliminated, affecting accuracy. The actual voltage value D collected by the analog-to-digital converter is the voltage value D collected by the analog-to-digital converter after power-on initialization. t Subtract the voltage value D collected by the analog-to-digital converter during power-on initialization o , the D o is the sum of the current transformer reference voltage and zero drift.
[0042] Figure 2 A flow chart of a method for calculating direct current of a power supply according to an embodiment of the present invention is shown.
[0043] like Figure 2 As shown, this embodiment may include the following steps:
[0044] S11, obtain the actual voltage value D collected by the analog-to-digital converter and the current transformer reference voltage V ref , analog-to-digital converter input range gain Beta and current amplification factor Mult;
[0045] S12, according to the actual voltage value D collected by the analog-to-digital converter and the current transformer reference voltage V ref , the analog-to-digital converter input range gain Beta and the current amplification factor Mult are used to calculate the current value I.
[0046] In this embodiment, according to the actual voltage value D collected by the analog-to-digital converter, the current transformer reference voltage V ref , the analog-to-digital converter input range gain Beta and the current amplification factor Mult calculate the current value I, including:
[0047] In this embodiment, obtaining the actual voltage value D collected by the analog-to-digital converter includes:
[0048] When the power is turned on and initialized, the analog-to-digital converter collects the voltage value D0;
[0049] After the power-on initialization is completed, the analog-to-digital converter collects the voltage value Dt ;
[0050] According to the collected voltage value D0 and the collected voltage value D t Calculate the voltage value D actually collected by the analog-to-digital converter;
[0051] In this embodiment, according to the collected voltage value D0, the collected voltage value D t Calculate the voltage value D, including: D = D t -D0.
[0052] In this embodiment, the collected voltage value D0 is the sum of the current transformer reference voltage and the current transformer zero drift. At this time, the external load is 0, D0 = φ × (V ref +V oe ),
[0053] Where V ref1 is the analog-to-digital converter reference voltage, V oe is the current transformer zero drift, V ref is the current transformer reference voltage and Beta is the analog-to-digital converter input range gain.
[0054] In this embodiment, when the power is initialized, if the power supply unit is in the calibration mode, software calibration is performed to eliminate the error existing in the current transformer. When performing the software calibration, the current line to be monitored is first unplugged from the current transformer to ensure that the current transformer is in an absolute no-load state during the software calibration; during the software operation, the error is reduced by filtering.
[0055] In the calibration of this embodiment, the hardware uses a jumper to short-circuit the J16 current line to be monitored, and the software will only perform calibration when it recognizes that the J16 current line is short-circuited.
[0056] In the case of uncalibrated, the calculated current value I is:
[0057] The hardware circuit can eliminate the reference voltage error, but it cannot eliminate the zero drift. For a 20A range power supply, the zero drift affects the accuracy as follows:
[0058]
[0059] The present invention combines software and hardware to perform calibration through an algorithm. When the power is turned on and initialized, the voltage value D0 collected by the analog-to-digital converter is the sum of the current transformer reference voltage and the current transformer zero drift, D0 = φ × (V ref +V oe). After the power-on initialization is completed, the voltage value collected by the analog-to-digital converter is D t , calculate the actual collected voltage value D = D t -D0. The calculated current value is:
[0060]
[0061] In terms of hardware, a jumper is used to short-circuit J16. The software will perform calibration only when it recognizes that J16 is short-circuited. This method can eliminate the reference voltage error and zero drift error to ensure accuracy. The current transformer only needs to be calibrated once before leaving the factory.
[0062] The power supply DC current calculation method and monitoring system of the present invention include obtaining the voltage value D actually collected by the analog-to-digital converter; obtaining the current transformer reference voltage V ref ; Obtain the analog-to-digital converter input range gain Beta; Obtain the current amplification factor Mult; According to the voltage value D actually collected by the analog-to-digital converter, the current transformer reference voltage V ref , the analog-to-digital converter input range gain Beta, the current amplification factor Mult calculates the current value I, and eliminates the zero drift error and electrical offset error through the combination of software and hardware, ensuring accuracy, thereby solving the problem in the prior art that only the zero drift error is eliminated through software or hardware, and other errors cannot be eliminated, affecting the accuracy.
[0063] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A method for calculating direct current of a power supply, characterized in that: The method comprises: S11, obtain the actual voltage value D collected by the analog-to-digital converter and the current transformer reference voltage V ref , analog-to-digital converter input range gain Beta and current amplification factor Mult; S12, according to the actual voltage value D collected by the analog-to-digital converter and the current transformer reference voltage V ref , the analog-to-digital converter input range gain Beta and the current amplification factor Mult calculate the current value I; Said The step of obtaining the actual voltage value D collected by the analog-to-digital converter comprises: When the power is turned on and initialized, the analog-to-digital converter collects the voltage value D0; After the power-on initialization is completed, the analog-to-digital converter collects the voltage value D t ; According to the collected voltage value D0 and the collected voltage value D t Calculate the voltage value D actually collected by the analog-to-digital converter, including: D = D t -D0; The collected voltage value D0 is the sum of the current transformer reference voltage and the current transformer zero drift. At this time, the external load is 0, D0 = φ × (V ref +V oe ), Where V ref1 is the analog-to-digital converter reference voltage, V oe is the current transformer zero drift, V ref is the current transformer reference voltage, Beta is the analog-to-digital converter input range gain; When the power is initialized, if the power supply is in the calibration mode, software calibration is performed to eliminate the error of the current transformer. When performing the software calibration, the current line to be monitored is first unplugged from the current transformer to ensure that the current transformer is in an absolute no-load state during the software calibration.
2. The method according to claim 1, characterized in that The current transformer reference voltage V ref =2.5±0.025V.
3. The method according to claim 1, characterized in that The current transformer zero drift V oe =±10mV.
4. The method according to claim 1, characterized in that: The power supply is an AC-to-DC power supply with a DC current monitoring range of 0-40A, which is used to monitor the voltage and current information of the power supply. The power supply supplies power to the external load and the internal monitoring module at the same time.
5. A power supply DC current monitoring system, characterized in that: The system comprises: The power supply unit is used to provide external power supply current to the external load and to provide the internal monitoring module monitoring circuit with the power supply current it needs; A current transformer, used for contactlessly collecting the current provided by the power supply unit to the external load and the current provided by the internal monitoring module; An analog-to-digital converter, used for receiving and converting the data collected by the current transformer, and transmitting the processed data to the CPU; The CPU is used to receive and process the data output by the analog-to-digital converter, and execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Hall current sensor zero calibration method and device
CN108680885A
Direct current component suppression method and related equipment thereof
CN112737295A
Standard clamp rail type intelligent photovoltaic battery pack string monitoring device
CN103780203A
Leakage current detection method and device
CN107064611A