Abnormality detection circuit, control method, switching power supply circuit and electric equipment
By designing an abnormality detection circuit, using current sensors and detection modules to detect the input current and control signals of the power switch, the problem of abnormal power switch on and off status in the prior art cannot be detected in time, and the stability and reliability of the switching power supply circuit are improved. sex.
Patent Information
- Application Number
- CN202411647791.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, abnormal on-off state of the power switch cannot be detected in time, which affects the stability and reliability of the switching power supply circuit.
An abnormality detection circuit is designed, including a current sensor, a detection module and a main control chip. By detecting the input current of the power switch and the control signal output by the driving chip, a detection signal is generated to determine whether the on-off state is abnormal.
It can detect abnormal on-off status abnormalities of the power switch in a timely and accurate manner, and improve the stability and reliability of the switching power supply circuit.
Smart Images

Figure CN119471347A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic circuits, and in particular to an abnormality detection circuit, a control method, a switching power supply circuit and an electrical device. Background Art
[0002] The traditional linear power supply has a large energy loss in the conversion process, which is particularly important today when energy is increasingly scarce. In order to reduce the overall energy consumption and operating costs, the emergence of switching power supply circuits has not only broadened the use environment, but also significantly improved the power conversion efficiency. With the development of technology, various types of power switches (such as MOSFET and IGBT) have appeared, the power conversion process has been simplified, and the efficiency has been improved, which has led to the widespread application of switching power supply circuits. The main working principle of the switching power supply circuit is to use components such as inductors, power switches and diodes to increase and decrease the voltage. Its main working principle is to control the charging and discharging of inductors and capacitors through the high-speed opening and closing of the power switch to achieve voltage rise and fall. However, the current switching power supply circuit lacks a monitoring circuit to monitor the on-off status of the power switch. If the resistance value of the driving resistor of the power switch drifts, the control end of the power switch will not accurately receive the PWM control signal output by the driving chip, and then it will not be able to open and close according to the PWM control signal. If the above abnormal situation cannot be discovered in time, the stability and reliability of the switching power supply circuit will be affected.
[0003] Currently, no effective solution has been proposed to solve the problem that the abnormal on / off state of the power switch in the prior art cannot be detected in time, thereby affecting the stability and reliability of the switching power supply circuit. Summary of the invention
[0004] An abnormality detection circuit, a control method, a switching power supply circuit and an electrical device are provided in the embodiments of the present invention to solve the problem in the prior art that the abnormal on / off state of the power switch cannot be detected in time, thereby affecting the stability and reliability of the switching power supply circuit.
[0005] In order to solve the above technical problems, the present invention provides an abnormality detection circuit applied to a power switch, the abnormality detection circuit comprising:
[0006] A current sensor, arranged at the input end of the power switch, for detecting the input current of the power switch;
[0007] a detection module connected to the driving chip and the current sensor, used to obtain a control signal output by the driving chip for the power switch, and also used to generate a detection signal based on an input current of the power switch and the control signal;
[0008] The main control chip is connected to the detection module and is used to determine whether the on / off state of the power switch is abnormal according to the detection signal.
[0009] Furthermore, the detection module includes:
[0010] a first detection unit, an input end of which is connected to the current sensor and configured to output a first detection signal based on an input current of the power switch;
[0011] a subtraction unit, whose input end is connected to the output end of the first detection unit, and is used to generate a second detection signal based on the first detection signal and a control signal output by the driving chip for the power switch;
[0012] a window comparator, whose input end is connected to the output end of the subtraction operation unit, and whose output end is connected to the main control chip, and the window comparator is used to generate a third detection signal and a fourth detection signal according to the second detection signal;
[0013] The main control chip is used to determine whether the on / off state of the power switch is abnormal according to the third detection signal and the fourth detection signal.
[0014] Furthermore, the first detection unit includes:
[0015] The first comparator has a non-inverting input terminal connected to the current sensor, an inverting input terminal inputting a first reference voltage, and an output terminal connected to an input terminal of the subtraction operation unit.
[0016] Furthermore, the subtraction unit comprises:
[0017] A subtractor, whose positive input end is connected to the output end of the first detection unit, whose negative input end is respectively connected to the driving chip of the power switch and the reference ground, and whose output end is connected to the input end of the window comparator.
[0018] Furthermore, the window comparator comprises:
[0019] A second comparator, whose non-inverting input terminal is used to input a second reference voltage ref2, whose inverting input terminal is connected to the output terminal of the subtractor, and whose output terminal is connected to the main control chip;
[0020] The third comparator has a non-inverting input terminal connected to the output terminal of the subtractor, an inverting input terminal for inputting a third reference voltage ref3, and an output terminal connected to the main control chip.
[0021] Furthermore, the main control chip is used for:
[0022] When the second comparator and the third comparator both output high level signals, determining that the on / off state of the power switch is normal;
[0023] When both the second comparator and the third comparator output low-level signals, or the second comparator outputs a low-level signal and the third comparator outputs a high-level signal, it is determined that the on-off state of the power switch is abnormal.
[0024] Furthermore, the circuit further comprises:
[0025] The alarm device is connected to the main control chip, and the main control chip controls the alarm device to sound an alarm when the on / off state of the power switch is abnormal.
[0026] The present invention also provides a switching power supply circuit, comprising a power switch and the above-mentioned abnormality detection circuit.
[0027] The present invention also provides an electrical device, comprising the above-mentioned switching power supply circuit.
[0028] The present invention also provides a control method, which is applied to the above abnormality detection circuit, and the control method includes:
[0029] Generate a detection signal based on an input current of the power switch and a control signal output by a driver chip for the power switch;
[0030] Whether the on / off state of the power switch is abnormal is determined according to the detection signal.
[0031] Further, judging whether the on / off state of the power switch is abnormal according to the detection signal includes:
[0032] Acquire the level signals output by the second comparator and the third comparator in the window comparator;
[0033] If both the second comparator and the third comparator output high level signals, it is determined that the on / off state of the power switch is normal;
[0034] If both the second comparator and the third comparator output low-level signals, or the second comparator outputs a low-level signal and the third comparator outputs a high-level signal, it is determined that the on-off state of the power switch is abnormal;
[0035] The input ends of the second comparator and the third comparator are connected to the output end of the subtractor, the input end of the subtractor is connected to the output end of the first detection unit, the input end of the first detection unit is connected to the current sensor, and the current sensor is used to detect the input current of the power switch.
[0036] Further, after determining that the on / off state of the power switch is abnormal, the control method further includes:
[0037] Control the alarm device to sound an alarm.
[0038] The present invention also provides a computer-readable storage medium on which a computer program is stored, and the program implements the above control method when executed by a processor.
[0039] The present invention also provides an electronic device, comprising:
[0040] one or more processors;
[0041] The storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned control method.
[0042] By applying the technical solution of the present invention, the input current of the power switch is detected, and a detection signal is generated based on the input current of the power switch. The input current can characterize the on-off state of the power switch, and then compared with the control signal for the power switch output by the driver chip, and the detection signal is generated according to the above input current and the above control signal. Specifically, if the above on-off state matches the above control signal, the detection signal generated by the two can characterize that the on-off state of the power switch is normal. If the above on-off state does not match the above control signal, the detection signal generated by the two can characterize that the on-off state of the power switch is abnormal. Through the above solution, the abnormal on-off state of the power switch can be discovered in a timely and accurate manner, and the components can be replaced or repaired in a timely manner, thereby improving the stability and reliability of the switching power supply circuit. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a structural block diagram of an abnormality detection circuit according to an embodiment of the present invention;
[0044] Figure 2 A diagram showing a corresponding relationship between a current signal and a voltage signal of a current sensor according to an embodiment of the present invention;
[0045] Figure 3 is an abnormality detection circuit according to another embodiment of the present invention;
[0046] Figure 4 is a waveform comparison diagram of a PWM control signal output by a driving chip, a voltage output by a current sensor, and a first detection signal according to an embodiment of the invention;
[0047] Figure 5 is a structural diagram of a switching power supply circuit according to an embodiment of the present invention;
[0048] Figure 6 is a flow chart of a control method according to an embodiment of the present invention;
[0049] Figure 7FIG. 4 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.
[0051] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0052] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0053] It should be understood that, although the terms first, second, third, etc. may be used to describe the comparator in the embodiments of the present invention, these comparators should not be limited to these terms. These terms are only used to distinguish different comparators. For example, without departing from the scope of the embodiments of the present invention, the first comparator may also be referred to as the second comparator, and similarly, the second comparator may also be referred to as the first comparator.
[0054] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0055] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.
[0056] The optional embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0057] Example 1
[0058] In view of the problem that the abnormal on / off state of the power switch in the prior art cannot be detected in time, thereby affecting the stability and reliability of the switching power supply circuit, this embodiment provides an abnormality detection circuit applied to the power switch. Figure 1 is a structural block diagram of an abnormality detection circuit according to an embodiment of the present invention, Figure 1 As shown, the abnormality detection circuit includes:
[0059] The current sensor 1 is arranged at the input end of the power switch and is used to detect the input current of the power switch. The input current of the power switch can reflect the conduction state of the power switch. If the power switch is conducted, the input current of the power switch will be greater than 0. If the power switch is conducted, the input current of the power switch will be 0. In this embodiment, the current sensor can adopt a Rogowski coil. During the detection, the Rogowski coil is sleeved on the wire of the input end of the power switch. By detecting the induced current in the Rogowski coil, the current flowing through the wire of the input end of the power switch is obtained, and then the input current of the power switch is converted into a voltage signal, which is then output to the detection module 2. The detection module 2 generates a detection signal based on the voltage signal. Figure 2 : is a corresponding relationship diagram between the current signal and the voltage signal of the current sensor according to an embodiment of the present invention, such as Figure 2 As shown, when the current detected by the current sensor of this embodiment is 0, the output voltage is 2.5V. As the detected current increases, the output voltage of 2.5V also gradually increases.
[0060] The detection module 2 is connected to the driver chip and the current sensor 1, and is used to obtain the control signal output by the driver chip for the power switch, and is also used to generate a detection signal based on the input current of the power switch and the control signal. The detection module 2 compares whether the detection signal and the control signal output by the driver chip for the power switch match. If they match, a normal detection signal is output to indicate that the on-off state of the power switch is normal. If they do not match, a normal detection signal is output to indicate that the on-off state of the power switch is abnormal.
[0061] The main control chip 3 is connected to the detection module 2 and is used to determine whether the on / off state of the power switch is abnormal according to the above detection signal.
[0062] The abnormality detection circuit of this embodiment detects the input current of the power switch, generates a detection signal based on the input current of the power switch, and the input current can characterize the on-off state of the power switch, and then compares it with the control signal for the power switch output by the driver chip, and generates a detection signal according to the above input current and the above control signal. Specifically, if the above on-off state matches the above control signal, the detection signal generated by the two can characterize that the on-off state of the power switch is normal, and if the above on-off state does not match the above control signal, the detection signal generated by the two can characterize that the on-off state of the power switch is abnormal. Through the above scheme, the abnormal on-off state of the power switch can be discovered in a timely and accurate manner, and the components can be replaced or repaired in a timely manner, thereby improving the stability and reliability of the switching power supply circuit.
[0063] Figure 3 According to another embodiment of the abnormality detection circuit of the present invention, the current sensor described above obtains the current flowing through the wire at the input end of the power switch, and then converts the input current of the power switch into a voltage signal. Therefore, in order to obtain the current flowing through the wire at the input end of the power switch detected by the current sensor, and then judge the on-off state of the power switch, as shown in FIG. Figure 3 As shown, the detection module 2 includes: a first detection unit 21, whose input end is connected to the current sensor, and is used to output a first detection signal based on the input current of the power switch. The first detection unit 21 includes: a first comparator U1, whose non-inverting input end is connected to the current sensor, whose inverting input end is input with the first reference voltage Vref1, and whose output end is connected to the input end of the subtraction unit 22.
[0064] In order to determine whether the detection signal matches the control signal output by the driver chip for the power switch, Figure 3 As shown, the detection module 2 also includes: a subtraction unit 22, whose input end is connected to the output end of the first detection unit 21, and is used to generate a second detection signal based on the first detection signal and the control signal for the power switch output by the driver chip. The subtraction unit 22 includes: a subtractor U2, whose positive input end is connected to the output end of the first detection unit 21 through a first resistor R1, whose negative input end is connected to the driver chip of the power switch through a second resistor R2, whose negative input end is connected to the reference ground through a third resistor R3, and whose output end is connected to the input end of the window comparator 23.
[0065] Since the detection signal and the control signal for the power switch output by the driving chip do not match, there are two specific situations. One is that the control signal of the power switch is at a high level, but the power switch is not turned on, and the other is that the control signal of the power switch is at a low level, but the power switch is turned on. In order to simultaneously detect these two mismatch phenomena, the detection module 2 also includes: a window comparator 23, whose input end is connected to the output end of the subtraction unit 22, and whose output end is connected to the main control chip, and the window comparator is used to generate a third detection signal V3 and a fourth detection signal V4 according to the second detection signal V2; the main control chip 3 determines whether the on-off state of the power switch is abnormal according to the third detection signal V3 and the fourth detection signal V4.
[0066] Furthermore, in order to detect the above two situations: the control signal of the power switch is at a high level but the power switch is not turned on, and the control signal of the power switch is at a low level but the power switch is turned on, the window comparator 23 includes: a second comparator U3, whose non-phase input terminal is used to input the second reference voltage ref2, whose inverting input terminal is connected to the output terminal of the subtractor, and whose output terminal is connected to the main control chip; a third comparator U4, whose non-phase input terminal is connected to the output terminal of the subtractor, whose inverting input terminal is used to input the third reference voltage ref3, and whose output terminal is connected to the main control chip.
[0067] The principle of the abnormality detection circuit of this embodiment is as follows: the detected current is converted into a voltage signal by utilizing the electrical characteristics of the current sensor, and compared with the first reference voltage through the first comparator U1. If the voltage value carried by the voltage signal is greater than the first reference voltage Vref1, the first comparator U1 outputs a high level; if the voltage value carried by the voltage signal is less than the first reference voltage Vref1, the first comparator U1 outputs a low level, that is, the first comparator U1 outputs a first detection signal V1, and the first detection signal V1 and the PWM wave control signal output by the driving chip of the power switch are calculated by the subtraction operation unit 22, and the second detection signal V2 is output according to the calculation result, and then the window comparator is used for data processing to obtain two-bit binary data. The chip will process according to this data to determine whether the on-off state of the power switch is abnormal.
[0068] Figure 4 FIG. 1 is a waveform comparison diagram of a PWM control signal output by a driving chip according to an embodiment of the present invention, a voltage output by a current sensor, and a first detection signal, as shown in FIG. Figure 4 As shown in the figure, when the power switch is turned on, the current starts to rise, and the current value detected by the current sensor rises from 0A. Figure 2It can be seen that the value of the voltage signal output by the current sensor increases from 2.5V according to a certain slope. Therefore, as the value of the voltage signal output by the current sensor increases, the input voltage of the non-inverting input terminal of the first comparator U1 is greater than 2.5V, which is higher than the first reference voltage Vref1 of 2.5V at the inverting input terminal. Since the voltage input to the non-inverting input terminal of the first comparator U1 is greater than the voltage input to the inverting input terminal, the first detection signal V1 output by the first comparator U1 is a 5V voltage; when the power switch is turned off, the circuit is disconnected, the input current of the power switch is 0A, and the voltage value input to the non-inverting input terminal of the first comparator U1 is 2.5V. Since some comparators have a bias or reference voltage, the voltage value of the non-inverting input terminal is equal to the inverting input terminal at this time, and the first detection signal V1 output by the first comparator U1 is a 0V voltage.
[0069] The value of the first reference voltage Vref1 is determined according to the current sensor selection. Taking the current sensor model selected here as an example, the current-voltage conversion relationship can be queried according to the sensor specification. When the current starts to rise from 0A, the voltage rises from 2.5V. Therefore, the first reference voltage Vref1 is selected as 2.5V. The selection principle is that when the current is detected, the voltage value converted by the sensor must be greater than the first reference voltage Vref1.
[0070] The first detection signal V1 output by the first comparator U1 and the PWM control signal output by the driver chip of the power switch are input to the subtraction unit 22 together. After the subtraction unit 22 performs subtraction operation on the two waveforms, it outputs the second detection signal V2. The second detection signal V2 has three voltage values: +5V, -5V, and 0V. When the first detection signal V1 is consistent with the PWM control signal output by the driver chip of the power switch, the voltage value of the second detection signal V2 is 0V; when the first detection signal V1 is 5V and the value of the PWM control signal is 0V, the voltage value of the second detection signal V2 is +5V, indicating that the control signal output by the driver chip of the power switch is 0V (off signal), but the power switch is turned on, that is, the power switch is turned off abnormally; when the first detection signal V1 is 0V and the value of the PWM control signal is 5V, the voltage value of the second detection signal V2 is -5V, indicating that the control signal output by the driver chip of the power switch is 5V (on signal), but the power switch is turned off, that is, the power switch is turned on abnormally. The second detection signal V2 is input to the window comparator 23. The window comparator 23 includes a second comparator U3 and a third comparator U4. When the value of the second detection signal V2 is 0V, the second comparator U3 outputs a high level and the third comparator U4 outputs a high level, indicating that the on-off state of the power switch matches the control signal output by the driver chip, that is, the on-off state of the power switch is normal; when the value of the second detection signal V2 is +5V, the second comparator U3 outputs a low level and the third comparator U4 outputs a high level, indicating that the control signal output by the driver chip of the power switch is 0V (off signal), but the power switch is turned on, that is, the power switch is turned off abnormally; when the value of the second detection signal V2 is -5V, the second comparator U3 outputs a low level and the third comparator U4 outputs a low level, indicating that the control signal output by the driver chip of the power switch is 5V (on signal), but the power switch is turned off, that is, the power switch is turned on abnormally. Therefore, when the second comparator U3 and the third comparator U4 both output high-level signals, the main control chip 3 determines that the on-off state of the power switch is normal; when the second comparator U3 and the third comparator U4 both output low-level signals, or the second comparator U3 outputs a low-level signal and the third comparator U4 outputs a high-level signal, the main control chip 3 determines that the on-off state of the power switch is abnormal. Specifically, when the second comparator U3 outputs a low level and the third comparator U4 outputs a high level, it is determined that the power switch is abnormally turned off, and when the second comparator U3 outputs a low level and the third comparator U4 outputs a low level, it is determined that the power switch is abnormally turned on.
[0071] In a specific implementation, in order to remind the staff that the on-off state of the power switch is abnormal, the above-mentioned abnormality detection circuit also includes: an alarm device D, which is connected to the main control chip 3 through the fourth resistor R4. When the on-off state of the power switch is abnormal, the main control chip 3 controls the alarm device D to sound an alarm. The alarm device can be an LED lamp or a buzzer lamp. In this embodiment, the LED lamp is used as an example for description.
[0072] The main control chip 3, after receiving the third detection signal V3 output by the second comparator U3 and the third detection signal V4 output by the third comparator U4, performs the next step of processing. Specifically: when the waveforms of V3 and V4 are high level and high level, the IO port of the main control chip outputs a low level, and the control LED light is off, indicating that the on-off state of the power switch is normal at this time; when V3 is low level and V4 is high level, the IO port of the main control chip outputs a high level, and the control LED light is on, indicating that the on-off state of the power switch is abnormal; when V3 is low level and V4 is low level, the IO port of the main control chip outputs a high level, and the control LED light is on, indicating that the on-off state of the power switch is abnormal.
[0073] Example 2
[0074] This embodiment provides a switching power supply circuit, including a power switch, and also includes the abnormality detection circuit of the above embodiment, Figure 5 is a structural diagram of a switching power supply circuit according to an embodiment of the present invention, as shown Figure 5 As shown, the switching power supply circuit is a BUCK step-down circuit, which includes an inductor L1, a capacitor C1, a diode D1 and a load R0 in addition to a power switch.
[0075] Example 3
[0076] This embodiment provides an electrical device, including the switching power supply circuit of the above embodiment.
[0077] Example 4
[0078] This embodiment provides a control method, which is applied to the abnormality detection circuit of the above embodiment. Figure 6 is a flow chart of a control method according to an embodiment of the present invention, as shown in Figure 6 As shown, the control method includes:
[0079] S101 , generating a detection signal based on an input current of the power switch and a control signal output by a driving chip for the power switch.
[0080] In specific implementation, the current flowing through the wire at the input end of the power switch can be obtained by detecting the induced current in the Rogowski coil, and then the input current of the power switch is converted into a voltage signal, which is then output to the detection module 2. The detection module 2 generates a detection signal based on the voltage signal.
[0081] S102, judging whether the on / off state of the power switch is abnormal according to the detection signal.
[0082] The main control chip 3 compares the detection signal with the control signal for the power switch output by the driving chip to see if they match. If they match, a normal detection signal is output to indicate that the on-off state of the power switch is normal. If they do not match, an abnormal detection signal is output to indicate that the on-off state of the power switch is abnormal.
[0083] The control method of this embodiment detects the input current of the power switch, generates a detection signal based on the input current of the power switch, and the input current can characterize the on-off state of the power switch, and then compares it with the control signal for the power switch output by the driver chip, and generates a detection signal based on the above input current and the above control signal. Specifically, if the above on-off state matches the above control signal, the detection signal generated by the two can characterize that the on-off state of the power switch is normal, and if the above on-off state does not match the above control signal, the detection signal generated by the two can characterize that the on-off state of the power switch is abnormal. Through the above scheme, the abnormal on-off state of the power switch can be discovered in a timely and accurate manner, and the components can be replaced or repaired in a timely manner, thereby improving the stability and reliability of the switching power supply circuit.
[0084] Judging whether the on-off state of the power switch is abnormal according to the detection signal includes: acquiring the level signals output by the second comparator and the third comparator in the window comparator; if the second comparator and the third comparator both output high-level signals, judging that the on-off state of the power switch is normal; if the second comparator and the third comparator both output low-level signals, or the second comparator outputs a low-level signal and the third comparator outputs a high-level signal, judging that the on-off state of the power switch is abnormal; wherein the input ends of the second comparator and the third comparator are connected to the output end of the subtractor, the input end of the subtractor is connected to the output end of the first detection unit, the input end of the first detection unit is connected to the current sensor, and the current sensor is used to detect the input current of the power switch.
[0085] The first detection signal V1 output by the first comparator U1 and the PWM control signal output by the driver chip of the power switch are input to the subtraction unit 22 together. After the subtraction unit 22 performs subtraction operation on the two waveforms, it outputs the second detection signal V2. The second detection signal V2 has three voltage values: +5V, -5V, and 0V. When the first detection signal V1 is consistent with the PWM control signal output by the driver chip of the power switch, the voltage value of the second detection signal V2 is 0V; when the first detection signal V1 is 5V and the value of the PWM control signal is 0V, the voltage value of the second detection signal V2 is +5V, indicating that the control signal output by the driver chip of the power switch is 0V (off signal), but the power switch is turned on, that is, the power switch is turned off abnormally; when the first detection signal V1 is 0V and the value of the PWM control signal is 5V, the voltage value of the second detection signal V2 is -5V, indicating that the control signal output by the driver chip of the power switch is 5V (on signal), but the power switch is turned off, that is, the power switch is turned on abnormally. The second detection signal V2 is input to the window comparator 23. The window comparator 23 includes a second comparator U3 and a third comparator U4. When the value of the second detection signal V2 is 0V, the second comparator U3 outputs a high level and the third comparator U4 outputs a high level, indicating that the on-off state of the power switch matches the control signal output by the driver chip, that is, the on-off state of the power switch is normal; when the value of the second detection signal V2 is +5V, the second comparator U3 outputs a low level and the third comparator U4 outputs a high level, indicating that the control signal output by the driver chip of the power switch is 0V (off signal), but the power switch is turned on, that is, the power switch is turned off abnormally; when the value of the second detection signal V2 is -5V, the second comparator U3 outputs a low level and the third comparator U4 outputs a low level, indicating that the control signal output by the driver chip of the power switch is 5V (on signal), but the power switch is turned off, that is, the power switch is turned on abnormally. Therefore, when the second comparator U3 and the third comparator U4 both output high-level signals, the main control chip 3 determines that the on-off state of the power switch is normal; when the second comparator U3 and the third comparator U4 both output low-level signals, or the second comparator U3 outputs a low-level signal and the third comparator U4 outputs a high-level signal, the main control chip 3 determines that the on-off state of the power switch is abnormal. Specifically, when the second comparator U3 outputs a low level and the third comparator U4 outputs a high level, it is determined that the power switch is abnormally turned off, and when the second comparator U3 outputs a low level and the third comparator U4 outputs a low level, it is determined that the power switch is abnormally turned on.
[0086] In a specific implementation, in order to remind the staff that the on / off state of the power switch is abnormal, the abnormality detection circuit further includes: an alarm device D connected to the main control chip 3, and the main control chip 3 controls the alarm device to sound an alarm when the on / off state of the power switch is abnormal. The alarm device can be an LED lamp or a buzzer lamp, and the LED lamp is used as an example for explanation in this embodiment.
[0087] The main control chip, after receiving the third detection signal V3 output by the second comparator U3 and the third detection signal V4 output by the third comparator U4, performs the next step of processing. Specifically: when the waveforms of V3 and V4 are high level and high level, the IO port of the main control chip outputs a low level, and the control LED light is off, indicating that the on-off state of the power switch is normal at this time; when V3 is low level and V4 is high level, the IO port of the main control chip outputs a high level, and the control LED light is on, indicating that the on-off state of the power switch is abnormal; when V3 is low level and V4 is low level, the IO port of the main control chip outputs a high level, and the control LED light is on, indicating that the on-off state of the power switch is abnormal.
[0088] Example 5
[0089] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the control method of the above embodiment is implemented.
[0090] Example 6
[0091] This embodiment provides an electronic device, including:
[0092] one or more processors;
[0093] The storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the control method of the above embodiment.
[0094] Figure 7 FIG. 1 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Figure 7 As shown, the device includes:
[0095] One or more processors 710 and memory 720, Figure 7 A processor 710 is taken as an example.
[0096] The electronic device may further include: an input device 730 and an output device 740 .
[0097] The processor 710, the memory 720, the input device 730 and the output device 740 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0098] The memory 720 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the control method in the embodiment of the present invention. The processor 710 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 720, that is, implementing the above method embodiment.
[0099] The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store an application required for operating the device and at least one function; the data storage area may store data created according to the use of the control method, etc. In addition, the memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0100] The input device 730 may receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. The output device 740 may include a display device such as a display screen.
[0101] The one or more modules are stored in the memory 720, and when executed by the one or more processors 710, perform the control method in any of the above method embodiments.
[0102] The electronic device can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0103] The electronic device of the embodiment of the present invention exists in various forms, including but not limited to:
[0104] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0105] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0106] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0107] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, device bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0108] (5) Other electronic devices with data interaction functions, such as televisions, large-screen cars, etc.
[0109] The circuit embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An abnormality detection circuit, applied to a power switch, characterized in that: The circuit comprises: A current sensor, arranged at the input end of the power switch, for detecting the input current of the power switch; a detection module connected to the driving chip and the current sensor, used to obtain a control signal output by the driving chip for the power switch, and also used to generate a detection signal based on an input current of the power switch and the control signal; The main control chip is connected to the detection module and is used to determine whether the on / off state of the power switch is abnormal according to the detection signal.
2. The circuit according to claim 1, characterized in that The detection module comprises: a first detection unit, an input end of which is connected to the current sensor and configured to output a first detection signal based on an input current of the power switch; a subtraction unit, whose input end is connected to the output end of the first detection unit, and is used to generate a second detection signal based on the first detection signal and the control signal output by the driving chip for the power switch; a window comparator, whose input end is connected to the output end of the subtraction operation unit, and whose output end is connected to the main control chip, and is used to generate a third detection signal and a fourth detection signal according to the second detection signal; The main control chip is used to determine whether the on / off state of the power switch is abnormal according to the third detection signal and the fourth detection signal.
3. The circuit according to claim 2, characterized in that The first detection unit comprises: The first comparator has a non-inverting input terminal connected to the current sensor, an inverting input terminal inputting a first reference voltage, and an output terminal connected to an input terminal of the subtraction operation unit.
4. The circuit according to claim 2, characterized in that The subtraction unit comprises: A subtractor, whose positive input end is connected to the output end of the first detection unit, whose negative input end is respectively connected to the driving chip of the power switch and the reference ground, and whose output end is connected to the input end of the window comparator.
5. The circuit according to claim 2, characterized in that The window comparator comprises: A second comparator, whose non-inverting input terminal is used to input a second reference voltage ref2, whose inverting input terminal is connected to the output terminal of the subtractor, and whose output terminal is connected to the main control chip; The third comparator has a non-inverting input terminal connected to the output terminal of the subtractor, an inverting input terminal for inputting a third reference voltage ref3, and an output terminal connected to the main control chip.
6. The circuit according to claim 5, characterized in that The main control chip is used for: When the second comparator and the third comparator both output high level signals, determining that the on / off state of the power switch is normal; When both the second comparator and the third comparator output low-level signals, or the second comparator outputs a low-level signal and the third comparator outputs a high-level signal, it is determined that the on-off state of the power switch is abnormal.
7. The circuit according to claim 1, characterized in that The circuit further comprises: The alarm device is connected to the main control chip, and the main control chip controls the alarm device to sound an alarm when the on / off state of the power switch is abnormal.
8. A switching power supply circuit, comprising a power switch, characterized in that: It also includes the abnormality detection circuit according to any one of claims 1 to 7.
9. An electrical device, characterized in that: Includes the switching power supply circuit as claimed in claim 8.
10. A control method, applied to the abnormality detection circuit according to any one of claims 1 to 7, characterized in that: The control method comprises: Generate a detection signal based on an input current of the power switch and a control signal output by a driver chip for the power switch; Whether the on / off state of the power switch is abnormal is determined according to the detection signal.
11. The control method according to claim 10, characterized in that: Judging whether the on / off state of the power switch is abnormal according to the detection signal includes: Acquire the level signals output by the second comparator and the third comparator in the window comparator; If both the second comparator and the third comparator output high level signals, it is determined that the on / off state of the power switch is normal; If both the second comparator and the third comparator output low-level signals, or the second comparator outputs a low-level signal and the third comparator outputs a high-level signal, it is determined that the on-off state of the power switch is abnormal; The input ends of the second comparator and the third comparator are connected to the output end of the subtractor, the input end of the subtractor is connected to the output end of the first detection unit, the input end of the first detection unit is connected to the current sensor, and the current sensor is used to detect the input current of the power switch.
12. The control method according to claim 11, characterized in that: After determining that the on / off state of the power switch is abnormal, the control method further includes: Control the alarm device to sound an alarm.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 10 to 12 is implemented.
14. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 10 to 12.