CN-121984484-A - PWM driving circuit and overcurrent protection method, medium, equipment and product thereof
Abstract
The invention discloses a PWM driving circuit overcurrent protection method, which relates to the field of circuit overcurrent protection, and comprises the steps that a double-channel comparator respectively compares the magnitude of a processed sampling signal with the magnitude of a preset first overcurrent protection value and a preset second overcurrent protection value, and if the processed sampling signal is larger than the preset first overcurrent protection value, a first channel outputs a signal A; if the current is larger than a preset second overcurrent protection value, a second channel outputs a signal B, the signal B pulls down an enabling signal to stop a load and start short-circuit alarm, if the MCU receives the signal B, the short-circuit alarm is started, the MCU only receives the signal A, when the actual current is smaller than a first overcurrent threshold value and is not processed, the overcurrent type is judged according to the fault duration time and corresponding processing is executed when the actual current is larger than or equal to the first overcurrent threshold value and smaller than the second overcurrent threshold value, and when the actual current is larger than or equal to the second overcurrent threshold value, the MCU immediately stops and starts the short-circuit alarm. The scheme of the invention has high response speed and high flexibility.
Inventors
- KUANG YI
- YANG ZEMING
- LI DONGQING
- PENG YI
- JIA HAIYANG
- YE NAN
Assignees
- 中电科创智联(武汉)有限责任公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251230
Claims (10)
- 1. A PWM driving circuit overcurrent protection method, comprising: The method comprises the steps that an MCU generates PWM signals and enable signals to control a half-bridge pre-driving circuit, the half-bridge pre-driving circuit drives upper bridge arm NMOS tubes and lower bridge arm NMOS tubes to be alternately conducted, PWM signals are output to drive a load, a load end sampling circuit samples load current, the load current is amplified by a differential amplifier and subjected to RC filtering to obtain processed sampling signals, the processed sampling signals are input into a two-channel comparator, a first channel of the two-channel comparator compares the processed sampling signals with a preset first overcurrent protection value, a second channel compares the processed sampling signals with a preset second overcurrent protection value, if the processed sampling signals are larger than the preset first overcurrent protection value, the first channel outputs a trigger signal A, and if the processed sampling signals are larger than the preset second overcurrent protection value, the second channel outputs a trigger signal B, and the signal B pulls down the enable signals to stop the load and start short-circuit alarm; The processed sampling signals are simultaneously input into an MCU, the MCU converts the analog signals into digital quantities through timing sampling, and actual current is calculated; the MCU receives the trigger signals A and B, and if the MCU receives the trigger signal B, short-circuit alarm is started; The MCU only receives the trigger signal A, does not process when the actual current is smaller than the first overcurrent threshold, starts fault timing when the actual current is larger than or equal to the first overcurrent threshold and smaller than the second overcurrent threshold, judges the overcurrent type according to the fault time and executes corresponding processing, and immediately stops and starts short-circuit alarm when the actual current is larger than or equal to the second overcurrent threshold.
- 2. The method of claim 1, wherein the sampling frequency of the MCU timing samples is 10 times higher than the PWM frequency.
- 3. The overcurrent protection method of the PWM driving circuit according to claim 1, wherein the formula of the actual current calculated by the MCU is: actual current = value of ADC x ADC reference voltage/(resolution of ADC x sampling resistance).
- 4. A kind of according to claim 1 the over-current protection method of the PWM driving circuit, it is characterized in that the method comprises the steps of, The overcurrent type comprises false overcurrent, instantaneous overcurrent and continuous overcurrent, and duration thresholds t1, t2 and t3 are set, wherein t1< t2< t3, when the fault duration is less than or equal to t1, the false overcurrent is judged, t1< the fault duration is less than or equal to t2, the instantaneous overcurrent is judged, t2< the fault duration is reached, and the duration reaches t3, and the continuous overcurrent is judged.
- 5. A kind of according to claim 4 the over-current protection method of the PWM driving circuit, it is characterized in that the method comprises the steps of, The method comprises the steps of stopping the machine when false overcurrent occurs, recording logs only, automatically restarting after a PWM period is turned off when the false overcurrent occurs, resetting through MCU software after the PWM is turned off when the false overcurrent occurs continuously, and stopping the machine to give an alarm if the false overcurrent and the overload overcurrent occur continuously for more than 3 times.
- 6. A kind of according to claim 1 the over-current protection method of the PWM driving circuit, it is characterized in that the method comprises the steps of, The first overcurrent threshold is adjusted according to the PWM duty ratio, and the duty ratio value range is divided into the following three sections according to the load application scene: When (when) , ; When (when) , ; When (when) , Wherein D represents the duty cycle, A first over-current threshold value is indicated, In order to adjust the threshold value as required, 、 And To adjust the coefficient according to the requirement, satisfy , , , 。
- 7. A PWM driving circuit is characterized by being used for realizing the overcurrent protection method according to any one of claims 1-6, and comprises an MCU, a half-bridge pre-driving circuit, a load end sampling circuit, a differential amplifier, an RC filter circuit and a double-channel comparator.
- 8. A computer-readable storage medium, in which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any one of claims 1-6.
- 9. An electronic device comprising a processor and a memory, the processor being interconnected with the memory, wherein the memory is configured to store a computer program comprising computer readable instructions, the processor being configured to invoke the computer readable instructions to perform the method of any of claims 1-6.
- 10. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method of any of claims 1-6.
Description
PWM driving circuit and overcurrent protection method, medium, equipment and product thereof Technical Field The invention relates to the technical field of circuit overcurrent protection, in particular to a PWM driving circuit, an overcurrent protection method, medium, equipment and a product thereof. Background The PWM driving circuit is widely used in electronic devices to control the switching state of a power device, so as to realize efficient power regulation. As the requirements of electronic devices for power control accuracy and reliability continue to increase, the design of PWM drive circuits has become more complex and refined. At present, a common PWM driving circuit in the market mostly adopts a Microcontroller (MCU) to generate PWM signals, and controls on and off of a power device through a driving chip. However, these circuits still have a certain limitation in terms of overcurrent protection, and are easily damaged by current abrupt changes or load anomalies. The specific solution of the prior art is that the existing PWM driving circuit generally adopts the following schemes that firstly, a current sensor detects load current and feeds back a signal to an MCU, MCU software judges whether protection is triggered or not, and secondly, a hardware comparator is used for directly monitoring a current signal, and when the current exceeds a threshold value, the driving signal is immediately cut off. The first scheme has the advantages of high flexibility, low response speed and possibly incapability of protecting the circuit in time, and the second scheme has the advantages of high response speed, high circuit complexity and inflexible threshold adjustment. The prior art lacks a scheme which has high response speed and high flexibility and can process various overcurrent faults. Disclosure of Invention The invention aims to solve the problems of low response speed, insufficient flexibility and difficulty in processing various overcurrent faults in the prior art, and provides a PWM driving circuit overcurrent protection method, which comprises the following steps: The method comprises the steps that an MCU generates PWM signals and enable signals to control a half-bridge pre-driving circuit, the half-bridge pre-driving circuit drives upper bridge arm NMOS tubes and lower bridge arm NMOS tubes to be alternately conducted, PWM signals are output to drive a load, a load end sampling circuit samples load current, the load current is amplified by a differential amplifier and subjected to RC filtering to obtain processed sampling signals, the processed sampling signals are input into a two-channel comparator, a first channel of the two-channel comparator compares the processed sampling signals with a preset first overcurrent protection value, a second channel compares the processed sampling signals with a preset second overcurrent protection value, if the processed sampling signals are larger than the preset first overcurrent protection value, the first channel outputs a trigger signal A, and if the processed sampling signals are larger than the preset second overcurrent protection value, the second channel outputs a trigger signal B, and the signal B pulls down the enable signals to stop the load and start short-circuit alarm; The processed sampling signals are simultaneously input into an MCU, the MCU converts the analog signals into digital quantities through timing sampling, and actual current is calculated; the MCU receives the trigger signals A and B, and if the MCU receives the trigger signal B, short-circuit alarm is started; The MCU only receives the trigger signal A, does not process when the actual current is smaller than the first overcurrent threshold, starts fault timing when the actual current is larger than or equal to the first overcurrent threshold and smaller than the second overcurrent threshold, judges the overcurrent type according to the fault time and executes corresponding processing, and immediately stops and starts short-circuit alarm when the actual current is larger than or equal to the second overcurrent threshold. Further, the sampling frequency of the MCU timing samples is 10 times higher than the PWM frequency. Further, the formula for calculating the actual current by the MCU is as follows: actual current = value of ADC x ADC reference voltage/(resolution of ADC x sampling resistance). Further, the method comprises the steps of, The overcurrent type comprises false overcurrent, instantaneous overcurrent and continuous overcurrent, and duration thresholds t1, t2 and t3 are set, wherein t1< t2< t3, when the fault duration is less than or equal to t1, the false overcurrent is judged, t1< the fault duration is less than or equal to t2, the instantaneous overcurrent is judged, t2< the fault duration is reached, and the duration reaches t3, and the continuous overcurrent is judged. Further, the method comprises the steps of, The method comprises the steps of stopping the mac