PWM drive circuit and overcurrent protection method thereof, medium, equipment and product
By setting a dual-channel comparator in the PWM drive circuit and combining software judgment with hardware protection, the overcurrent threshold is dynamically adjusted, which solves the problems of slow response speed and insufficient flexibility in the existing technology, and realizes fast and flexible overcurrent protection that can adapt to a variety of overcurrent faults.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CLP TECH INNOVATION ZHILIAN (WUHAN) CO LTD
- Filing Date
- 2025-12-30
- Publication Date
- 2026-05-05
AI Technical Summary
Existing PWM drive circuits have slow response speed and insufficient flexibility in overcurrent protection, making it difficult to handle various overcurrent faults and easily causing device damage due to sudden current changes or abnormal loads.
The MCU generates PWM signals and enable signals to control the half-bridge pre-drive circuit. Combined with the load-side sampling circuit, differential amplifier, RC filter and dual-channel comparator, two overcurrent thresholds are set for hardware protection. The software determines the overcurrent type and performs corresponding processing, and dynamically adjusts the overcurrent thresholds to adapt to different application scenarios.
It achieves fast-response and flexible overcurrent protection, can handle a variety of overcurrent faults, avoids false triggering, and improves the reliability and adaptability of the circuit.
Smart Images

Figure CN121984484A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of circuit overcurrent protection technology, and in particular to PWM drive circuits and their overcurrent protection methods, media, devices and products. Background Technology
[0002] PWM drive circuits are widely used in electronic devices to control the switching states of power devices for efficient power regulation. As the requirements for power control accuracy and reliability in electronic devices continue to increase, the design of PWM drive circuits has become more complex and sophisticated. Currently, most commercially available PWM drive circuits use microcontrollers (MCUs) to generate PWM signals and control the on / off state of power devices through a driver chip. However, these circuits still have certain limitations in overcurrent protection and are susceptible to damage from sudden current changes or abnormal loads.
[0003] Existing solutions for overcurrent protection typically employ the following methods: First, a current sensor detects the load current and feeds the signal back to the MCU, where the MCU software determines whether protection is triggered. Second, a hardware comparator directly monitors the current signal, immediately cutting off the drive signal when the current exceeds a threshold. The first method offers high flexibility but has a slow response time, potentially failing to protect the circuit in time. The second method offers fast response but has higher circuit complexity and less flexibility in threshold adjustment. Current technology lacks a solution that offers both fast response and high flexibility, capable of handling various overcurrent faults. Summary of the Invention
[0004] The purpose of this invention is to address the problems of slow response speed, insufficient flexibility, and difficulty in handling various overcurrent faults in existing technologies by proposing an overcurrent protection method for PWM drive circuits, comprising: The MCU generates PWM signals and enable signals to control the half-bridge pre-drive circuit. The high and low levels of the half-bridge pre-drive circuit drive the upper and lower bridge arm NMOS transistors to conduct alternately, outputting PWM signals to drive the load. The load sampling circuit samples the load current, which is amplified by a differential amplifier and filtered by an RC filter to obtain a processed sampling signal. The processed sampling signal is input to a dual-channel comparator. The first channel of the dual-channel comparator compares the processed sampling signal with a preset first overcurrent protection value, and the second channel compares the processed sampling signal with a preset second overcurrent protection value. If the processed sampling signal is greater than the preset first overcurrent protection value, the first channel outputs a trigger signal A. If the processed sampling signal is greater than the preset second overcurrent protection value, the second channel outputs a trigger signal B. Signal B pulls down the enable signal to stop the load and activate a short-circuit alarm. The second overcurrent protection value is the short-circuit protection value and is greater than the first overcurrent protection value. The processed sampling signal is simultaneously input to the MCU. The MCU converts the analog signal into a digital quantity through timed sampling and calculates the actual current. The MCU receives trigger signals A and B. If the MCU receives trigger signal B, it will activate a short circuit alarm. The MCU only receives trigger signal A. When the actual current is less than the first overcurrent threshold, it does not perform any processing. When the actual current is greater than or equal to the first overcurrent threshold and less than the second overcurrent threshold, it starts a fault timer, determines the overcurrent type based on the fault time, and performs corresponding processing. When the actual current is greater than or equal to the second overcurrent threshold, it immediately stops the machine and starts a short-circuit alarm.
[0005] Furthermore, the sampling frequency of the MCU timing sampling is 10 times higher than the PWM frequency.
[0006] Furthermore, the formula for the MCU to calculate the actual current is: Actual current = ADC value × ADC reference voltage / (ADC resolution × sampling resistor).
[0007] Furthermore, The overcurrent types include spurious overcurrent, transient overcurrent, and continuous overcurrent. Duration thresholds t1, t2, and t3 are set, where t1 < t2 < t3. When the fault duration ≤ t1, it is determined to be a spurious overcurrent; when t1 < fault duration ≤ t2, it is determined to be a transient overcurrent; when t2 < fault duration and the time reaches t3, it is determined to be a continuous overcurrent.
[0008] Furthermore, In the event of a false overcurrent, the system will not shut down but will only log the event; in the event of a momentary overcurrent, the system will automatically restart after shutting down the PWM for one cycle; in the event of a continuous overcurrent, the system will be reset via MCU software after shutting down the PWM; if more than three consecutive momentary overcurrents and overload overcurrents occur, the system will shut down and alarm will be triggered.
[0009] Furthermore, The first overcurrent threshold is adjusted based on the PWM duty cycle. The duty cycle value range is divided into the following three segments according to the load application scenario: when , ; when , ; when ,
[0010] Where D represents the duty cycle, Indicates the first overcurrent threshold. The threshold is adjusted as needed. , and To adjust the coefficients as needed, to satisfy , , , .
[0011] The present invention also proposes a PWM drive circuit for implementing the above-mentioned overcurrent protection method, comprising: MCU, half-bridge pre-drive circuit, load, load-side sampling circuit, differential amplifier, RC filter circuit, and dual-channel comparator.
[0012] The present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described overcurrent protection method for a PWM drive circuit.
[0013] The present invention also proposes an electronic device, including a processor and a memory, wherein the processor and the memory are interconnected, the memory is used to store a computer program, the computer program includes computer-readable instructions, and the processor is configured to invoke the computer-readable instructions to execute the above-described PWM drive circuit overcurrent protection method.
[0014] The present invention also proposes a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-described PWM drive circuit overcurrent protection method.
[0015] The beneficial effects of the technical solution provided by this invention are: This invention uses hardware to set two different overcurrent thresholds. When the current exceeds the larger short-circuit overcurrent threshold, the hardware immediately shuts down. When the current reaches the smaller overcurrent threshold but not the short-circuit threshold, software determines the overcurrent type. The software also sets different overcurrent thresholds, and the smaller software threshold can be dynamically adjusted to meet different application scenarios and avoid false triggering. When the actual current calculated by the software exceeds the larger software-set overcurrent threshold, it is determined to be a short-circuit fault, compensating for hardware short-circuit detection errors. When the actual current calculated by the software is between the two software-set thresholds, the fault type is determined based on the fault time and appropriate processing is performed. This invention offers fast response speed and high flexibility, and can handle various overcurrent faults. Attached Figure Description
[0016] Figure 1 This is a structural block diagram of the PWM drive circuit according to an embodiment of the present invention; Figure 2 This is a block diagram of an electronic device according to an exemplary embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0018] A structural block diagram of the PWM driving circuit in this embodiment of the invention is shown below. Figure 1 Specifically, it includes: MCU, half-bridge pre-drive circuit, load, load-side sampling circuit, differential amplifier, RC filter, and dual-channel comparator.
[0019] The overcurrent protection method for the PWM drive circuit of the present invention is implemented based on the above-mentioned PWM drive circuit, and specifically includes: The MCU generates a PWM signal and an enable signal EN to control the half-bridge pre-drive circuit. The enable signal is used to enable or disable the PWM signal; EN=1 indicates that the PWM signal is enabled, and EN=0 indicates that the PWM signal is disabled. The high and low levels of the half-bridge pre-drive circuit drive the upper and lower bridge arm NMOS transistors to conduct alternately, outputting a PWM signal to drive the load. The load sampling circuit samples the load current, which is amplified by a differential amplifier and filtered by an RC filter to obtain a processed sampled signal. The processed sampled signal is input to a dual-channel comparator. The first channel (channel A) of the dual-channel comparator compares the processed sampled signal with a preset first overcurrent protection value, and the second channel (channel B) compares the processed sampled signal with a preset second overcurrent protection value. If the processed sampled signal is greater than the preset first overcurrent protection value, the first channel outputs a trigger signal A (signal toggles). If the processed sampled signal is greater than the preset second overcurrent protection value, the second channel outputs a trigger signal B (signal toggles). Signal B pulls the enable signal low, stopping the load and triggering a short-circuit alarm. The second overcurrent protection value is the short-circuit protection value and is greater than the first overcurrent protection value.
[0020] The aforementioned hardware protection enables emergency short-circuit shutdown protection. The first and second overcurrent protection values are preset according to the application scenario. The first overcurrent protection value is lower than the second overcurrent protection value, and the second overcurrent protection value is the short-circuit protection value, facilitating rigid short-circuit protection. Overcurrent faults include not only short-circuit faults but also false overcurrents, transient overcurrents, and continuous overcurrents. False overcurrents are momentary false triggers caused by circuit noise and sampling interference, such as PWM switching spikes and power fluctuations. These have almost no impact on circuit operation, and directly using hardware for a rigid shutdown would delay operation. Transient overcurrents refer to currents that briefly exceed the first overcurrent threshold but do not exceed the second overcurrent threshold (short-circuit current threshold), and then quickly return to normal, with minimal impact on the circuit. Continuous overcurrents refer to currents that exceed the first overcurrent threshold but do not reach the second overcurrent threshold (short-circuit current threshold) for a relatively long duration; such as overload, immediate shutdown is generally not necessary. Immediate shutdown for false overcurrents, transient overcurrents, and continuous overcurrents would complicate troubleshooting the cause of the circuit fault.
[0021] If the hardware determines that a short circuit is not the cause, software analysis is required, and appropriate actions must be taken based on the analysis results. The software analysis process is as follows: The processed sampled signal is simultaneously input to the MCU's ADC pin. The MCU samples the signal at a timed frequency, which is more than 10 times higher than the PWM frequency, ensuring that no peak current is missed. The analog signal is then converted into a digital value to calculate the actual current. The formula for calculating the actual current by the MCU is: Actual current = ADC value × ADC reference voltage / (ADC resolution × sampling resistor).
[0022] The MCU receives trigger signals A and B. If the MCU receives trigger signal B, it will activate a short circuit alarm.
[0023] The MCU only receives trigger signal A. When the actual current is less than the first overcurrent threshold, no action is taken. When the actual current is greater than or equal to the first overcurrent threshold but less than the second overcurrent threshold, a fault timer is started. The overcurrent type is determined based on the fault time and corresponding action is taken. When the actual current is greater than or equal to the second overcurrent threshold, the MCU immediately stops and a short-circuit alarm is started. The second overcurrent threshold is the short-circuit protection value set by the software.
[0024] Set duration thresholds t1, t2, and t3, where t1 < t2 < t3. When the fault duration is ≤ t1 (e.g., 20us), it is determined to be a false overcurrent; when t1 < fault duration ≤ t2 (e.g., 100us), it is determined to be an instantaneous overcurrent; when t2 < fault duration and the time reaches t3 (e.g., 1s), it is determined to be a continuous overcurrent.
[0025] In the event of a false overcurrent, the system will not shut down, but will only log the event to avoid malfunctions. In the event of a momentary overcurrent, the system will log the event, shut down the PWM for one cycle, and then automatically restart. In the event of an overcurrent of type overload, the system will log the event, shut down the PWM, and then reset the MCU via software. If more than three momentary overcurrents or overload overcurrents occur consecutively within a short period of time, a shutdown alarm will be triggered. The system will be restarted only after the fault has been resolved.
[0026] To adapt to the current load conditions at different stages of the load, the first overcurrent threshold (the first overcurrent threshold set by the software) is dynamically optimized. When the PWM duty cycle is small, the average load current is small, but the instantaneous peak current may be impacted by inductor energy storage and capacitor charging and discharging, such as in motor starting and low duty cycle high frequency drive scenarios. In these cases, the first overcurrent threshold needs to be appropriately increased to avoid false protection. When the PWM duty cycle is large, the average load current is close to the rated current, and the peak current lasts for a long time. Overcurrent will cause the power devices to heat up for a long time. In this case, the first overcurrent threshold needs to be reduced to enhance protection. When the PWM duty cycle is in the middle range, the first overcurrent threshold is dynamically adjusted linearly to balance protection accuracy and operational stability.
[0027] The overcurrent threshold is adjusted based on the PWM duty cycle. The duty cycle range is divided into three segments according to the load application scenario: when , ; when , ; when , .
[0028] Where D represents the duty cycle, Indicates the first overcurrent threshold. Indicates the maximum inrush current. The threshold is adjusted as needed. , and To adjust the coefficients as needed, to satisfy , , , .
[0029] This invention provides two scenarios, scenario one: when , ; when , ; when , .
[0030] Scene 2: when , ; when , ; when , .
[0031] This invention combines hardware and software. First, it implements hardware protection for short circuits. When the current value detected by the hardware falls between the first and second overcurrent protection values (the short-circuit protection current set by the hardware), the software determines the overcurrent type. Simultaneously, the software also sets a first and second overcurrent threshold, with the second threshold being the software-defined short-circuit protection current. When the actual current calculated by the software exceeds the second overcurrent threshold, a short-circuit fault is identified, and the system immediately shuts down, compensating for potential hardware errors in short-circuit fault detection. When the calculated actual current falls between the first and second overcurrent thresholds set by the software, different types of overcurrent faults are handled separately to avoid false triggering by interference signals. This invention offers high flexibility and fast response, providing timely circuit protection. The software thresholds are flexibly adjustable, capable of handling various overcurrent faults and generating corresponding logs and alarm information based on different overcurrent faults, facilitating subsequent troubleshooting.
[0032] In one exemplary embodiment, a computer-readable storage medium is included, which stores a computer program that, when executed by a processor, implements the above-described PWM drive circuit overcurrent protection method.
[0033] Please see Figure 2 In one exemplary embodiment, the device further includes an electronic device including at least one processor, at least one memory, and at least one communication bus.
[0034] The memory stores a computer program, which includes computer-readable instructions. The processor calls the computer-readable instructions stored in the memory through the communication bus to execute the above-mentioned PWM drive circuit overcurrent protection method.
[0035] In one exemplary embodiment, a computer program product is proposed, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described PWM drive circuit overcurrent protection method.
[0036] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for overcurrent protection of a PWM drive circuit, characterized in that, include: The MCU generates PWM signals and enable signals to control the half-bridge pre-drive circuit. The high and low levels of the half-bridge pre-drive circuit drive the upper and lower bridge arm NMOS transistors to conduct alternately, outputting PWM signals to drive the load. The load sampling circuit samples the load current. The load current is amplified by a differential amplifier and filtered by an RC filter to obtain a processed sampling signal. The processed sampling signal is input to a dual-channel comparator. The first channel of the dual-channel comparator compares the processed sampling signal with the preset first overcurrent protection value, and the second channel compares the processed sampling signal with the preset second overcurrent protection value. If the processed sampling signal is greater than the preset first overcurrent protection value, the first channel outputs a trigger signal A. If the processed sampling signal is greater than the preset second overcurrent protection value, the second channel outputs a trigger signal B. Signal B pulls down the enable signal to stop the load and start a short-circuit alarm. The second overcurrent protection value is the short-circuit protection value and is greater than the first overcurrent protection value; The processed sampling signal is simultaneously input to the MCU. The MCU converts the analog signal into a digital quantity through timed sampling and calculates the actual current. The MCU receives trigger signals A and B. If the MCU receives trigger signal B, it will activate a short circuit alarm. The MCU only receives the trigger signal A, and does not process it when the actual current is less than the first overcurrent threshold. When the actual current is greater than or equal to the first overcurrent threshold and less than the second overcurrent threshold, a fault timer is started, the overcurrent type is determined based on the fault time, and corresponding processing is performed. When the actual current is greater than or equal to the second overcurrent threshold, the machine will immediately stop and a short-circuit alarm will be activated.
2. The overcurrent protection method for a PWM drive circuit according to claim 1, characterized in that, The sampling frequency of the MCU timing sampling is 10 times higher than the PWM frequency.
3. The overcurrent protection method for a PWM drive circuit according to claim 1, characterized in that, The formula for the MCU to calculate the actual current is: Actual current = ADC value × ADC reference voltage / (ADC resolution × sampling resistor).
4. The overcurrent protection method for a PWM drive circuit according to claim 1, characterized in that, The overcurrent types include spurious overcurrent, transient overcurrent, and continuous overcurrent. Duration thresholds t1, t2, and t3 are set, where t1 < t2 < t3. When the fault duration ≤ t1, it is determined to be a spurious overcurrent; when t1 < fault duration ≤ t2, it is determined to be a transient overcurrent. If t2 < the fault duration and the time reaches t3, it is determined to be a continuous overcurrent.
5. The overcurrent protection method for a PWM drive circuit according to claim 4, characterized in that, In the event of a false overcurrent, the system will not shut down but will only log the event; in the event of a momentary overcurrent, the system will automatically restart after shutting down the PWM for one cycle; in the event of a continuous overcurrent, the system will be reset via MCU software after shutting down the PWM; if more than three consecutive momentary overcurrents and overload overcurrents occur, the system will shut down and alarm will be triggered.
6. The overcurrent protection method for a PWM drive circuit according to claim 1, characterized in that, The first overcurrent threshold is adjusted based on the PWM duty cycle. The duty cycle value range is divided into the following three segments according to the load application scenario: when , ; when , ; when , Where D represents the duty cycle, Indicates the first overcurrent threshold. The threshold is adjusted as needed. , and To adjust the coefficients as needed, to satisfy , , , .
7. A PWM drive circuit, characterized in that, The method for implementing the overcurrent protection method according to any one of claims 1-6 includes: an MCU, a half-bridge pre-drive circuit, a load, a load-side sampling circuit, a differential amplifier, an RC filter circuit, and a dual-channel comparator.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
9. An electronic device, characterized in that, The device includes a processor and a memory, the processor being interconnected with the memory, wherein the memory is used to store a computer program, the computer program including computer-readable instructions, and the processor is configured to invoke the computer-readable instructions to perform the method as described in any one of claims 1-6.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-6.