CN115166344A - Method, circuit, device and readable storage medium for current detection circuit - Google Patents

Method, circuit, device and readable storage medium for current detection circuit Download PDF

Info

Publication number
CN115166344A
CN115166344A CN202210667146.6A CN202210667146A CN115166344A CN 115166344 A CN115166344 A CN 115166344A CN 202210667146 A CN202210667146 A CN 202210667146A CN 115166344 A CN115166344 A CN 115166344A
Authority
CN
China
Prior art keywords
current
value
current detection
detection circuit
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210667146.6A
Other languages
Chinese (zh)
Inventor
张玉良
郑冬冬
付照德
彭佳勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Muyuan Foods Co Ltd
Original Assignee
Muyuan Foods Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Muyuan Foods Co Ltd filed Critical Muyuan Foods Co Ltd
Priority to CN202210667146.6A priority Critical patent/CN115166344A/en
Publication of CN115166344A publication Critical patent/CN115166344A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/25Arrangements for measuring currents or voltages or for indicating presence or sign thereof using digital measurement techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R15/00Details of measuring arrangements of the types provided for in groups G01R17/00 - G01R29/00, G01R33/00 - G01R33/26 or G01R35/00
    • G01R15/14Adaptations providing voltage or current isolation, e.g. for high-voltage or high-current networks
    • G01R15/20Adaptations providing voltage or current isolation, e.g. for high-voltage or high-current networks using galvano-magnetic devices, e.g. Hall-effect devices, i.e. measuring a magnetic field via the interaction between a current and a magnetic field, e.g. magneto resistive or Hall effect devices
    • G01R15/202Adaptations providing voltage or current isolation, e.g. for high-voltage or high-current networks using galvano-magnetic devices, e.g. Hall-effect devices, i.e. measuring a magnetic field via the interaction between a current and a magnetic field, e.g. magneto resistive or Hall effect devices using Hall-effect devices
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02HEMERGENCY PROTECTIVE CIRCUIT ARRANGEMENTS
    • H02H3/00Emergency protective circuit arrangements for automatic disconnection directly responsive to an undesired change from normal electric working condition with or without subsequent reconnection ; integrated protection
    • H02H3/08Emergency protective circuit arrangements for automatic disconnection directly responsive to an undesired change from normal electric working condition with or without subsequent reconnection ; integrated protection responsive to excess current
    • H02H3/10Emergency protective circuit arrangements for automatic disconnection directly responsive to an undesired change from normal electric working condition with or without subsequent reconnection ; integrated protection responsive to excess current additionally responsive to some other abnormal electrical conditions
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02HEMERGENCY PROTECTIVE CIRCUIT ARRANGEMENTS
    • H02H3/00Emergency protective circuit arrangements for automatic disconnection directly responsive to an undesired change from normal electric working condition with or without subsequent reconnection ; integrated protection
    • H02H3/24Emergency protective circuit arrangements for automatic disconnection directly responsive to an undesired change from normal electric working condition with or without subsequent reconnection ; integrated protection responsive to undervoltage or no-voltage
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02HEMERGENCY PROTECTIVE CIRCUIT ARRANGEMENTS
    • H02H7/00Emergency protective circuit arrangements specially adapted for specific types of electric machines or apparatus or for sectionalised protection of cable or line systems, and effecting automatic switching in the event of an undesired change from normal working conditions

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measurement Of Current Or Voltage (AREA)

Abstract

The invention discloses a method, a circuit, equipment and a readable storage medium for a current detection circuit, wherein the method comprises the following steps: receiving an initial current value changed from a current detection element in the current detection circuit; determining a first preset value for controlling the current detection circuit based on the initial current value; calculating a detection value detected by a current detection element in the electrified state according to the initial current value to determine an actual value of the current in the current detection circuit in the electrified state; and comparing the detection value with the first preset value to obtain a comparison result so as to protect equipment provided with the current detection circuit according to the comparison result. According to the scheme of the invention, the accuracy of current detection in the current detection circuit can be improved, so that the equipment provided with the current detection circuit can be protected in time according to the detection result.

Description

Method, circuit, device and readable storage medium for current detection circuit
Technical Field
The present invention relates generally to the field of detection circuits. More particularly, the present invention relates to a method, circuit, device and readable storage medium for a current sensing circuit.
Background
The current sampling circuit is often needed to be used in daily product design application to detect the current of equipment load, and the equipment is cut off and protected when the equipment current is higher than a certain value or is smaller than a certain value so as to prevent the equipment from being damaged. Furthermore, in some application occasions, the current of the whole current range of the equipment in working needs to be accurately detected in real time, so that the equipment can be cut off and protected in time. The detection circuit or the current detection device commonly used at present generally hardly satisfy the accurate detection of great electric current and less electric current in the wide range electric current simultaneously, in addition because current detection component self has certain error for the current detection component that different equipment used the same model also can increase the detection error of wide range electric current, thereby influences current detection's uniformity.
In the prior art, a high-precision current sampling chip is generally arranged in a detection circuit, and when the monitored current is abnormal, abnormal information can be fed back to a central processing unit in real time so as to process equipment loads. Although the scheme can solve the problem of large sampling error of the wide-range current to a certain extent, the high-precision current sampling chip is high in cost, and the actual using effect is common. In view of this, there is a need in the art for a method for detecting current that can solve the problem of large sampling error of wide-range current and does not require additional hardware cost.
Disclosure of Invention
In order to solve at least one or more technical problems in the background art, the invention provides a method, a circuit, a device and a readable storage medium of a current detection circuit. By the scheme of the invention, the accuracy of current detection can be improved, and extra hardware is not required. In one embodiment, the embodiment of the invention can simultaneously and accurately detect the larger current and the smaller current in the wide range of current, thereby improving the consistency of current detection. To this end, the present invention provides aspects as follows.
In a first aspect, the present invention discloses a method for a current sensing circuit, the method comprising: receiving an initial current value from a current detection element in the current detection circuit; determining a first preset value for controlling the current detection circuit based on the initial current value; calculating a detection value detected by a current detection element in the electrified state according to the initial current value to determine an actual value of the current in the current detection circuit in the electrified state; and comparing the detection value with the first preset value to obtain a comparison result so as to protect equipment arranged with the current detection circuit according to the comparison result.
In one embodiment, determining a first preset value for controlling the current detection circuit based on the initial current value comprises: acquiring a second preset value used for controlling the current detection circuit in the current detection circuit; and increasing or decreasing the second preset value based on the value of the initial current value to obtain the first preset value.
In another embodiment, the first preset value and the second preset value include an upper limit current value and a lower limit current value for controlling the current detection circuit.
In yet another embodiment, calculating a detection value detected via the current detection element in the energized state from the initial current value to determine an actual value of the current in the current detection circuit in the energized state includes: performing absolute value calculation on the detection value based on the value of the initial current value to obtain a calculation result; and taking the calculation result as an actual value of the current in the current detection circuit in the energized state.
In one embodiment, comparing the detection value to the first preset value comprises: comparing the detection value with a lower-limit current value of the first preset value; or comparing the detection value with an upper limit current value of the first preset value.
In another embodiment, the comparison result comprises: the detection value is positioned outside the lower limit current value and the upper limit current value range of the first preset value; or the detection value is within the lower limit current value and the upper limit current value of the first preset value.
In still another embodiment, protecting the device in which the current detection circuit is arranged according to the comparison result includes: controlling the current detection circuit to execute a power-off operation in response to the detection value being outside the lower-limit current value and the upper-limit current value range of the first preset value; or responding to the detection value being within the range of the lower limit current value and the upper limit current value of the first preset value, and enabling the current detection circuit to work normally.
In a second aspect, the present invention discloses a current detection circuit comprising: the power supply module is used for connecting a power supply so as to supply power to the current detection circuit; a current detection module electrically connected to the power supply module and configured to detect a current in the current detection circuit; and a protection module which is electrically connected with the power supply module and protects the equipment provided with the current detection circuit based on the current value detected by the current detection module.
In a third aspect, the present invention discloses an apparatus for a current sensing circuit, comprising: a processor; a memory storing program instructions for the current sensing circuit that, when executed by the processor, implement the method steps for the current sensing circuit described above.
In a fourth aspect, the invention discloses a computer readable storage medium storing program instructions for a current sensing circuit, which when executed by a processor, implement the above-described method steps for the current sensing circuit.
By using the method of the present invention described above and in the embodiments thereof, the present invention can determine the first preset value in the current detection circuit based on the initial current value from the current detection element, and can realize protection of the apparatus in which the current detection circuit is arranged according to the comparison result of the first preset value and the detected value of the current. Further, the detection value can be increased or decreased based on the initial current value to obtain the actual value of the current in the current detection circuit, so that accurate detection of the current can be realized.
In some embodiments, by using the embodiments of the present invention, a larger current and a smaller current in a wide range of currents can be detected, and the consistency of current detection when detecting the wide range of currents is improved. Further, according to the method for determining the actual value of the current through the initial current value disclosed in the embodiment of the invention, the problem that the current detection is inaccurate due to the error of the current detection element can be avoided when different devices use the same type of current detection element. In addition, the first preset value is determined according to the initial current value, so that the first preset value can be continuously changed according to the initial current value, and the mismatching between the detection value in the current detection circuit and the first preset value is avoided.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description, which proceeds with reference to the accompanying drawings. Several embodiments of the present invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar or corresponding parts and in which:
FIG. 1 is a flow chart illustrating a method for a current sensing circuit according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a current sensing circuit for a charging state according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating a method for a current sensing circuit according to another embodiment of the present invention; and
FIG. 4 is a schematic block diagram illustrating a system for a current sensing circuit according to an embodiment of the present invention.
Detailed Description
Embodiments will now be described with reference to the accompanying drawings. It will be appreciated that for simplicity and clarity of illustration, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein may be practiced without these specific details. In other instances, well-known methods, procedures, and components have not been described in detail so as not to obscure the embodiments described herein. Additionally, the description should not be taken as limiting the scope of the embodiments described herein.
FIG. 1 is a flow chart illustrating a method for a current sensing circuit according to an embodiment of the present invention. As shown in fig. 1, the method 100 may include: at step S102, an initial current value from the current detection element in the current detection circuit is received. In an application scenario, the current detection circuit may be configured to detect a current value in the circuit, and may timely perform protection switching-off on the device when the detected current value in the device is greater than or less than a set predetermined value. In one embodiment, the current sensing element may be a hall current sensing element for sensing a passing current in the circuit, and the hall current sensing element based on the hall effect may sense the current without making contact with the circuit under test so that the circuit under test is not affected. In addition, the Hall current detection element also has the characteristics of high sensitivity, wide working temperature range and the like. Further, the hall current detecting element may convert the detected current into a voltage for display based on the hall effect principle, and may transmit the voltage signal to the outside.
In one embodiment, the current detection circuit may be used to detect a wide range of currents in the circuit, where a wide range of currents may refer to currents that vary in magnitude in the device. For example, a current in a circuit changes from small to large during charging of a certain device, and the current may be referred to as a wide-range current. For another example, the current of the motor of the car or the robot at different speeds during driving the wheels is different, and thus the varying current can be called a wide-range current. It can be understood that, in the process of detecting the wide-range current, the current of the whole current range also needs to be accurately detected in real time, so that the equipment can be controlled or processed in time according to the detected current value.
In one embodiment, the initial current value may be a current value resulting from the current sensing element sensing current in the circuit within a time gap between the device turning on and sensing the current state in the circuit. In one embodiment, the initial current value may be a current value generated by an error of the current detection element itself and may vary, not being a fixed value. In one embodiment, the initial current value may be generated when a wide range of current sensing is performed. Specifically, when a wide-range current is detected, the current detection element needs to detect a larger current and a smaller current, and the current detection element has a larger span of the detected current value, so that the current detection element can generate an initial current value due to a functional defect of the current detection element when the wide-range current is detected, and further, detection errors are generated when the wide-range current is detected. In another embodiment, the initial current value may be generated when different devices perform current detection using the same model of current detection element. The reason for generating the initial current value is an error of the current detection element when the current detection element is applied to different devices, so that the current detection element generates an initial current value when the current detection element detects the current of different devices.
In one embodiment, the current generating the initial current value may be converted into a voltage signal by the hall current detection element, and the converted voltage signal may be transmitted to the microprocessor by the hall current detection element, and then the transmitted voltage signal may be converted into an analog-to-digital conversion value (i.e., an ADC value) by the microprocessor, so that the microprocessor may perform calculation. In one application scenario, the microprocessor may be a single chip microcomputer, and the single chip microcomputer may be integrated with a plurality of modules, such as a central processing unit CPU having a data processing capability, a random access memory RAM, a read only memory ROM, a plurality of I/O ports, an interrupt system, and an AD converter (analog-to-digital converter), where a voltage signal from the hall current detection element may be converted into an ADC value by the AD converter, so that the single chip microcomputer may record an initial current value.
Next, at step S104, a first preset value for controlling the current detection circuit may be determined based on the initial current value. In an application scenario, the current detection circuit may be controlled to be powered off according to the first preset value, so as to protect the device in which the current detection circuit is disposed. In one embodiment, determining the first preset value may include obtaining a second preset value in the current detection circuit for controlling the current detection circuit, and may increase or decrease the second preset value based on a value of the initial current value to obtain the first preset value. In another embodiment, the second preset value may be a preset value when the initial current value is zero, and may be changed according to a change in the initial current value to obtain the first preset value.
In one embodiment, the second preset value may be recorded by a microprocessor (e.g., a single chip microcomputer) according to an ADC value corresponding to the second preset value, and the first preset value may be obtained by the single chip microcomputer. Specifically, the single chip microcomputer records an ADC value corresponding to the initial current value and an ADC value corresponding to the second preset value. Further, the single chip microcomputer can learn when the ADC value corresponding to the initial current value changes, so that the ADC value corresponding to the second preset value can change along with the change of the ADC value corresponding to the initial current value to learn to obtain a new ADC value, and then the current value corresponding to the new ADC value can be used as the first preset value. In one embodiment, the change amount of the ADC value corresponding to the initial current value may be increased or decreased.
In one embodiment, the first preset value and the second preset value may further include an upper limit current value and a lower limit current value for controlling the current detection circuit. In an application scenario, when certain equipment is charged, the current changes from large to small, and then the overcurrent charging condition occurring in the charging process can be controlled to cut off the power of the current detection circuit through the upper limit current value set by the first preset value, so that the current detection circuit is protected. In another application scenario, the device can be powered off by the lower limit current value set by the first preset value during the charging process, so that the device can stop charging.
Thereafter, at step S106, a detection value detected via the current detection element in the energized state may be calculated from the initial current value to determine an actual value of the current in the current detection circuit in the energized state. In one embodiment, determining the actual value of the current in the current detection circuit in the energized state may include increasing or decreasing the detection value based on the value of the initial current value to obtain a calculation result, and the calculation result may be taken as the actual value of the current in the current detection circuit in the energized state. It is to be understood that the detected value detected via the current detecting element in the energized state is not an actual value of the current in the current detecting circuit in the present state, but a current value detected after an error occurs in the current detecting element and an initial current value is recorded. Therefore, the detection value needs to be increased or decreased according to the initial current value, so that the detection value can be removed from the initial current value to obtain the actual value of the current in the current detection circuit. In one embodiment, the actual value of the current in the current sensing circuit in the powered state may be determined using a single-chip microcomputer.
Then, at step S108, the detection value may be compared with a first preset value to obtain a comparison result, so as to implement protection of the device in which the current detection circuit is disposed according to the comparison result. In one embodiment, comparing the detection value with the first preset value may include comparing the detection value with a lower limit current value of the first preset value; or comparing the detection value with the upper limit current value of the first preset value. In still another embodiment, the result of comparing the detection value with the first preset value may include that the detection value is outside a lower limit current value and an upper limit current value range of the first preset value; or the detection value is within the lower limit current value and the upper limit current value of the first preset value.
In one embodiment, the lower limit current value and the upper limit current value range may be a numerical range greater than the lower limit current value and less than the upper limit current value. Correspondingly, the lower limit current value and the upper limit current value may be out of a range of values not greater than the lower limit current value or not less than the upper limit current value. In one embodiment, protecting the device in which the current detection circuit is disposed according to the comparison result includes controlling the current detection circuit to perform a power-off operation in response to the detection value being outside a lower limit current value and an upper limit current value range of the first preset value; or responding to the detection value within the range of the lower limit current value and the upper limit current value of the first preset value, and enabling the current detection circuit to work normally.
In summary, the embodiments of the present invention disclose a method for a current detection circuit, which can greatly reduce the detection error of the current detection circuit for a wide range of currents according to the obtained initial current value, and improve the consistency of current detection. Meanwhile, the actual value of the current in the current detection circuit is determined according to the initial current value, so that errors caused by devices when different equipment uses current detection elements of the same type are avoided, and the current detection is more accurate. In addition, according to the first preset value changed by the change of the initial current value, the first preset value used for controlling the current detection circuit can be ensured to always meet the condition under the condition that different initial current values are generated under different conditions.
The method for the current detection circuit of the embodiment of the present invention is exemplarily described above with reference to fig. 1. It is to be understood that the above description is intended to be illustrative, and not restrictive. To further understand the above method for the current detection circuit, the current detection circuit will be exemplarily described below with reference to fig. 2.
Fig. 2 is a schematic diagram illustrating a current sensing circuit for a charge state according to an embodiment of the present invention. As shown in the figure, the current detection circuit 200 may include a charger 201 for charging the device, and a power DC circuit 202 for supplying power to the current detection circuit, and after the charger 201 is connected to the current detection circuit, the power DC circuit 202 may output 5V for supplying power to the single chip 203, and may also output 3.3V for supplying power to the hall current detection chip 204 of the current detection circuit. Next, the current detection circuit 200 may further include a limit switch 205 for detecting whether a charger is inserted, a filter capacitor 206 connected to the limit switch 205 for filtering out interference of high frequency signals, and a pull-up resistor 207 connected to the filter capacitor 206 for providing a pull-up bias to the single chip 203.
Further, the current detection circuit 200 may further include a P-channel fet 208 and a P-channel fet 209, and the P-channel fet 208 and the P-channel fet 209 may be used to control the connection and disconnection between the positive electrode of the charger and the positive electrode of the battery. Next, the current detection circuit 200 may further include an isolation optocoupler 210 connected to the P-channel fet 208 and the P-channel fet 209, and the optocoupler primary may be controlled by a single chip processor to further control an optocoupler secondary, so as to implement on/off of the P-channel fet 208 and the P-channel fet 209. In addition, the current detection circuit 200 may further include a driving resistor 211 and a driving resistor 212, and further, a driving voltage may be applied to the gate of the P-channel fet 208 through the driving resistor 211, and a driving voltage may be applied to the gate of the P-channel fet 209 through the driving resistor 212.
Meanwhile, the current detection circuit 200 may further include a voltage dividing resistor 213 connected to the driving resistor 211, and a voltage dividing resistor 214 connected to the driving resistor 212, so that a proper gate voltage may be provided to the pfet 208 through the voltage dividing resistor 213, and a proper gate voltage may be provided to the pfet 209 through the voltage dividing resistor 214. In addition, the current detection circuit 200 may further include a zener diode 215 for stabilizing the gate-source voltages of the P- channel fets 208 and 209 and clamping to a regulated value at the zener diode 215 so that the zener diode 215 may be protected.
In order to detect the current in the circuit, the current detection circuit 200 may include a battery 216 connected to the hall current detection chip 204, a filter capacitor 217, a filter capacitor 218, and a filter capacitor 219 connected to the hall current detection chip 204 for filtering out high frequency signals, and a voltage dividing resistor 220 and a voltage dividing resistor 221 connected to the hall current detection chip 204, and may divide the voltage signal output from the hall current detection chip 204 and transmitted to the single chip microcomputer by the voltage dividing resistor 220 and the voltage dividing resistor 221, so that the voltage does not exceed the range of the single chip microcomputer. In addition, the current detection circuit 200 may include a zener diode 222 to stabilize the voltage signal after voltage division, which is output from the hall current detection chip 204 and transmitted to the single chip, and may clamp the regulated voltage value of the zener diode 222 to implement protection of the single chip.
In a charging state working scene, when the charger 201 is connected to the current detection circuit, the power supply DC circuit 202 may output 5V and 3.3V to supply power to the hall current detection chip 204 and the single chip 203. Meanwhile, when the limit switch 205 detects that the charger is plugged in, the limit switch 205 is turned on, so that the limit switch 205 can send a low level to the mcu 203 through the PWKEY _ a pin. Further, after the single chip microcomputer 203 detects that the pin PWKEY _ a is at a low level and delays for 3S, the single chip microcomputer 203 can output a low level to the isolation optocoupler 210 through the pin CTRL so that the isolation optocoupler 210 can be turned on. After the isolation optocoupler 210 is connected, the P-channel fet 208 and the P-channel fet 209 may also be connected according to the function of the isolation optocoupler, and the charger 201 may charge the battery 216 through the P-channel fet 208, the P-channel fet 209, and the hall current detection element 204. Meanwhile, the hall current detection element 204 can transmit a voltage signal to the single chip microcomputer 203 through the pin IS to realize the collection and detection of the charging current.
Further, when the voltage of the IS pin of the single chip microcomputer 203 IS greater than a preset value during overcurrent charging, the single chip microcomputer 203 transmits a high-level signal to the P-channel field effect transistor 208 and the P-channel field effect transistor 209 through the CTRL pin, so that the P-channel field effect transistor 208 and the P-channel field effect transistor 209 are cut off, and charging can be stopped. When the voltage of the IS pin IS lower than the preset value when the charging current IS too small, the single chip microcomputer 203 transmits a high-level signal to the P-channel field effect transistor 208 and the P-channel field effect transistor 209 through the CTRL pin, so that the P-channel field effect transistor 208 and the P-channel field effect transistor 209 are cut off, and charging can be stopped.
The circuit structure and the operation principle of the current detection circuit in the charging state are exemplarily described above with reference to fig. 2, and in order to further understand the method for the current detection circuit described above, the method for the current detection circuit according to the embodiment of the present invention will be exemplarily described below with reference to fig. 3 by taking the current detection circuit in the charging state in fig. 2 as an example.
Fig. 3 is a flow chart illustrating a method for a current sensing circuit according to another embodiment of the present invention. As shown in fig. 3, the method 300 may include: at step S302, a start operation is performed, wherein the start operation may include initialization of the current detection circuit. Next, at step S304, the charger may be connected to the current detection circuit, so that the power DC circuit outputs 5V and 3.3V to supply power to the hall current detection element and the single chip. Thereafter, in step S306, the limit switch detects that the charger is inserted, so that the limit switch is closed, and a level signal may be input to the single chip microcomputer through the PWKEY _ a pin.
Further, at step S308, the single chip may determine whether the input level signal is a low level signal. When the input level signal is not a low level, the flow returns to step S304, and the charger is connected to the current detection circuit; when the input level signal is a low level signal, the flow advances to step S310. At step S310, the hall current detecting element may output a voltage signal to the single chip via the IS pin, and may record the current value as an initial current value. In one embodiment, after the single chip detects that the PWKEY _ a pin is at a low level and delays for 3S, step S310 is executed. It can be understood that the delay time of the single chip microcomputer is not limited, and the delay time can be adjusted according to needs, so that the requirement that the Hall current detection element transmits the initial current value to the single chip microcomputer for recording is met.
After the above-described step S310 is executed, the flow advances to a step S312. In step S312, the single chip microcomputer outputs a low level signal through the CTRL pin to turn on the isolation optocoupler U1, and the P-channel fet Q1 and the P-channel fet Q2 may also be turned on after the isolation optocoupler U1 is turned on, so that the charger may charge the battery through the P-channel fet Q1, the P-channel fet Q2, and the hall current detection element U1. Meanwhile, the hall current detection element U1 can transmit the detection value of the current charging current in the current detection circuit to the IS pin of the single chip microcomputer through the IS pin.
Next, at step S314, the present actual current is calculated in combination with the initial current value. In one embodiment, the actual current of the present charging current may be calculated using a single chip microcomputer. In one embodiment, the single chip microcomputer may perform absolute value operation according to an ADC value corresponding to a previously recorded initial current value and an ADC value corresponding to a currently detected current detection value, so as to calculate the current in the current detection circuit. In another embodiment, the absolute value operation may be performed by the formula shown below.
Actual operating current value { [3.3V { [ ADC value corresponding to detected value of present charging current-ADC value corresponding to initial current value)/4096 ]/R7 { (R6 + R7) -2.5V }/sensitivity Sens (formula one)
Wherein 3.3V is the voltage value provided by the power supply DC circuit for the singlechip; the ADC value IS a value converted by the analog-to-digital converter from a voltage signal received by the singlechip through the IS pin, and IS a value which can be processed by the singlechip; 4096 is the maximum value of the analog-to-digital converter with 12 bits arranged inside the single chip microcomputer; r6 and R7 are resistance values of voltage dividing resistors; the sensitivity is the degree to which the hall current detection element is sensitive to current detection.
In one application scenario, a hall current detection element may be utilized to detect a large current during charging. Specifically, when the hall current detection element is used for detecting a large current in the charging process to obtain a detection value, the actual value of the large current can be calculated by the single chip microcomputer by using the first formula. In another application scenario, a hall current detection element may be used to detect a small current during charging, and similarly, a detected value of the detected small current value may be calculated by the above formula to obtain an actual value. Therefore, the problem that the simultaneous and accurate detection of large current and small current is difficult to meet in the prior art can be solved through the embodiment of the invention, and the consistency of current detection is further improved.
Further, at step S316, the preset overcurrent-current and full-charge currents may be learned and corrected according to the initial current value, and normal charging may be performed. It is to be understood that the preset overcurrent current and full-charge current may be a first preset value having an upper limit current value and a lower limit current value. In one embodiment, the preset overcurrent current and the full-charge current may be varied according to a variation of the initial current value. Thereafter, at step S318, it is determined whether the present charging current is greater than the corrected overcurrent current or less than the corrected full-charge current. In response to that the current charging current is not greater than the corrected overcurrent current or not less than the corrected full charge current, the process returns to step S312, so that the current detection circuit continues to charge the battery in the current detection circuit through the P-channel fet Q1, the P-channel fet Q2, and the hall current detection element U1 in the charging state. In response to the present charging current being greater than the corrected overcurrent current or less than the corrected full-charge current, the flow advances to step S320. In step S320, the single chip microcomputer may output a high level signal to the isolation optocoupler through the CTRL pin, and further may cut off the P-channel fet Q1 and the P-channel fet Q2, so as to stop charging the battery.
In a second aspect of the present invention, there is also provided a current detection circuit, comprising: the power supply module is used for connecting a power supply so as to supply power to the current detection circuit; a current detection module electrically connected to the power supply module and configured to detect a current in the current detection circuit; and a protection module which is electrically connected with the power supply module and protects the equipment provided with the current detection circuit based on the current value detected by the current detection module.
In a third aspect of the invention, there is provided an apparatus for a current sensing circuit, comprising: a processor; a memory storing program instructions for the device of the current detection circuit that, when executed by the processor, implement the above-described method steps. As will be described in connection with fig. 4.
FIG. 4 is a schematic block diagram illustrating a system for a current sensing circuit according to an embodiment of the present invention. The system 400 may include a device 401 for a current sense circuit and its peripherals and external networks to implement the method for a current sense circuit according to an embodiment of the present invention as described above in connection with fig. 1-3.
As shown in fig. 4, the apparatus 401 for the current detection circuit may include a CPU 4011, which may be a general-purpose CPU, a dedicated CPU, or other execution units of information processing and program execution. Further, the apparatus 401 for the current detection circuit may further include a mass memory 4012 and a read only memory ROM4013, wherein the mass memory 4012 may be configured to store various types of data. In the embodiment of the present invention, the current value may include an initial current value, a first preset value, and/or related data used in the embodiment of the present invention. In addition, the ROM 8013 may be configured as a driver for initialization of each functional block in the device 401 of the current detection circuit, basic input/output of the system, and data necessary for booting the operating system.
Further, the system 400 may also include other hardware platforms or components, such as the illustrated Tensor Processing Unit (TPU) 4014, image processing unit (GPU) 4015, field Programmable Gate Array (FPGA) 4016, and Machine Learning Unit (MLU) 4017. It is to be understood that although various hardware platforms or components are shown in the system 400, this is by way of example and not by way of limitation, and those skilled in the art may add or remove corresponding hardware as may be desired.
The apparatus 401 for the current detection circuit further includes a communication interface 4018 so that it can be connected to a local area network/wireless local area network (LAN/WLAN) 405 through the communication interface 4018, and further can be connected to a local server 406 through the LAN/WLAN or to the Internet ("Internet") 805. Alternatively or additionally, the device 401 for current detection circuitry of embodiments of the present invention may also be directly connected to the internet or cellular network based on wireless communication technology, such as third generation ("3G"), fourth generation ("4G"), or fifth generation ("5G") based wireless communication technology, through the communication interface 4018. In some application scenarios, the device 401 for current detection circuit may also access a server 408 of an external network and possibly a database 409 as needed in order to obtain various known second preset values, for example of the invention, and may remotely store various data calculated via formulas.
The peripheral devices of the apparatus 401 for current detection circuit may include a display device 402, an input device 403, and a data transmission interface 404. In one embodiment, the display device 402 may include, for example, one or more speakers and/or one or more visual displays configured to provide voice prompts and/or visual displays of the operational procedures or final results of the testing apparatus of the present invention. The input device 403 may include, for example, a keyboard, a mouse, a microphone, a gesture capture camera, or other input buttons or controls configured to receive input or user instructions to detect a call state. The data transfer interface 404 may include, for example, a serial interface, a parallel interface, or a universal serial bus interface ("USB"), a small computer system interface ("SCSI"), serial ATA, fireWire ("FireWire"), PCI Express, and a high-definition multimedia interface ("HDMI"), which are configured for data transfer and interaction with other devices or systems. According to the scheme of the invention, the device 401 for the current detection circuit of the embodiment of the invention further comprises a CPU 4011, a mass memory 4012, a read only memory ROM4013, a TPU 4014, a GPU 4015, an FPGA 4016, an MLU 4017 and a communication interface 4018, which can be connected with each other through a bus 4019, and data interaction with peripheral devices is realized through the bus. In one embodiment, the cpu 4011 can control other hardware components in the device 401 for current detection circuit and their peripherals through the bus 4019.
It should also be appreciated that any module, unit, component, server, computer, terminal, or device executing instructions of the examples of the invention may include or otherwise have access to a computer-readable medium, such as a storage medium, computer storage medium, or data storage device (removable) and/or non-removable) such as, for example, a magnetic disk, optical disk, or magnetic tape. Computer storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules or other data.
The present invention also discloses a computer readable storage medium having stored therein program instructions adapted to be loaded and executed by a processor: receiving an initial current value from a current detection element in the current detection circuit; determining a first preset value for controlling the current detection circuit based on the initial current value; calculating a detection value detected by a current detection element in a power-on state according to the initial current value to determine an actual value of current in the current detection circuit in the power-on state; and comparing the detection value with the first preset value to obtain a comparison result so as to protect equipment provided with the current detection circuit according to the comparison result. In this regard, when the solution of the present invention is embodied in the form of a software product (computer readable storage medium), the software product may be stored in a memory, and may include several instructions for causing a computer device (e.g., a personal computer, a server, or a network device, etc.) to perform some or all of the steps of the method described in the embodiments of the present invention. The aforementioned Memory may include, but is not limited to, a usb disk, a flash disk, a read only Memory ROM, a Random Access Memory ("RAM"), a removable hard disk, a magnetic disk, or an optical disk, and various media capable of storing program codes.
In summary, the embodiments of the present invention can utilize the obtained initial current value to realize accurate detection of current, and can also simultaneously and accurately detect a larger current and a smaller current in a wide range of currents. Further, according to the first preset value obtained in the embodiment of the present invention, the cut-off protection of the device in which the current detection circuit is disposed can be realized in time.
It should be understood that the possible terms "first" or "second" etc. in the claims, the description and the drawings of the present disclosure are used for distinguishing between different objects and not for describing a particular order. The terms "comprises" and "comprising," when used in the specification and claims of this disclosure, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only, and is not intended to be limiting of the invention disclosed. As used in the specification and claims of this disclosure, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the term "and/or" as used in this disclosure and claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
Although the embodiments of the present invention are described above, the descriptions are only examples adopted for understanding the present invention, and are not intended to limit the scope and application scenarios of the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for a current sensing circuit, comprising:
receiving an initial current value from a current detection element in the current detection circuit;
determining a first preset value for controlling the current detection circuit based on the initial current value;
calculating a detection value detected by a current detection element in the electrified state according to the initial current value to determine an actual value of the current in the current detection circuit in the electrified state; and
and comparing the detection value with the first preset value to obtain a comparison result so as to protect equipment provided with the current detection circuit according to the comparison result.
2. The method of claim 1, wherein determining a first preset value for controlling the current detection circuit based on the initial current value comprises:
acquiring a second preset value used for controlling the current detection circuit in the current detection circuit; and
and calculating the absolute value of the second preset value based on the value of the initial current value to obtain the first preset value.
3. The method of claim 2, wherein the first and second preset values comprise upper and lower current values for controlling the current detection circuit.
4. The method of claim 3, wherein calculating a detected value detected via a current detection element in the energized state from the initial current value to determine an actual value of current in the current detection circuit in the energized state comprises:
increasing or decreasing the detection value based on the value of the initial current value to obtain a calculation result; and
and taking the calculation result as an actual value of the current in the current detection circuit in the power-on state.
5. The method of claim 4, wherein comparing the detection value to the first preset value comprises:
comparing the detection value with a lower-limit current value of the first preset value; or
And comparing the detection value with the upper limit current value of the first preset value.
6. The method of claim 5, wherein the comparison comprises:
the detection value is positioned outside the lower limit current value range and the upper limit current value range of the first preset value; or
The detection value is within the range of the lower limit current value and the upper limit current value of the first preset value.
7. The method according to claim 6, wherein protecting the device in which the current detection circuit is disposed according to the comparison result comprises:
controlling the current detection circuit to execute a power-off operation in response to the detection value being outside the lower-limit current value and the upper-limit current value range of the first preset value; or
And responding to the detection value within the range of the lower limit current value and the upper limit current value of the first preset value, and enabling the current detection circuit to work normally.
8. A current sensing circuit, comprising:
the power supply module is used for connecting a power supply so as to supply power to the current detection circuit;
the current detection module is electrically connected with the power supply module and is used for detecting the current in the current detection circuit; and
and the protection module is in power-on connection with the power supply module and protects equipment provided with the current detection circuit based on the current value detected by the current detection module.
9. An apparatus for a current sense circuit, comprising:
a processor;
a memory storing program instructions for a current detection circuit, which when executed by the processor, implement the method steps for a current detection circuit according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that program instructions for a current detection circuit are stored, which program instructions, when executed by a processor, carry out the method steps for a current detection circuit according to any one of claims 1-7.
CN202210667146.6A 2022-06-13 2022-06-13 Method, circuit, device and readable storage medium for current detection circuit Pending CN115166344A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210667146.6A CN115166344A (en) 2022-06-13 2022-06-13 Method, circuit, device and readable storage medium for current detection circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210667146.6A CN115166344A (en) 2022-06-13 2022-06-13 Method, circuit, device and readable storage medium for current detection circuit

Publications (1)

Publication Number Publication Date
CN115166344A true CN115166344A (en) 2022-10-11

Family

ID=83485286

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210667146.6A Pending CN115166344A (en) 2022-06-13 2022-06-13 Method, circuit, device and readable storage medium for current detection circuit

Country Status (1)

Country Link
CN (1) CN115166344A (en)

Similar Documents

Publication Publication Date Title
US8970165B2 (en) Determination circuit
KR101515741B1 (en) Method and apparatus for measuring charging current
CN103268144B (en) Apparatus for monitoring power supply and over-current protection method
US9146261B2 (en) Electronic device and method of electronic device for determining power source device
JP2011259693A (en) Battery charging protective circuit
US20110015884A1 (en) System and method for automatic voltage range measurement
US11411423B2 (en) Charging control method, related device, and computer storage medium
CN112834898A (en) Method, device and equipment for testing stability of power supply chip of storage equipment
US9557789B2 (en) Power control device
CN115166344A (en) Method, circuit, device and readable storage medium for current detection circuit
CN101373396B (en) Current limiting protecting apparatus and current limiting protecting method
US11150284B2 (en) Frequency regulation method and apparatus
CN116662232A (en) Electronic equipment and detection method
CN116643637A (en) Power circuit, control method thereof, circuit board and computing device
US20130328580A1 (en) Test circuit for power supply unit
CN108761187B (en) Substrate current testing method and system and terminal equipment
KR101716942B1 (en) Charging a battery based on stored battery characteristics
CN116027207A (en) Battery electric quantity detection circuit, electronic equipment and electric quantity metering method
CN114844003A (en) Intelligent power distributor control method and terminal
CN115436827A (en) Insulation resistance detection method, device and equipment
CN112732498B (en) Test method, device, equipment and storage medium for simulating single-point power-on and power-off of equipment
CN112865229A (en) Charging protection circuit and wireless earphone
US9824553B2 (en) Distance detection system, vibration prompt circuit and vibration prompt method
CN113169385A (en) Battery pack, circuit system for measuring battery current and equipment for measuring battery current
CN116466122B (en) Current detection circuit, method, chip, electronic component and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination