Author Topic: Request for Technical Review of MOSFET H-Bridge Design (MCU blew while testing)  (Read 1208 times)

0 Members and 1 Guest are viewing this topic.

Offline MoFlavorTopic starter

  • Newbie
  • Posts: 5
  • Country: za
Hi everyone,
I am designing a discrete MOSFET H-bridge (sign-magnitude drive) for a small robotics application and would really appreciate a review of the design and testing approach. I am struggling somewhat currently and would love some advice/review. I have attatched three photos:
1. Switch/off times for the three mosfets in the b bridge circuit, along with the circuitry used to test the switch on/off times.
2. Full H-bridge circuit.
3. Diagram of the how two pwm signals(A and B) will change state of the H-Bridge and allow for forward, reverse and breaking of the motor

System Overview
Supply voltage: 11.1 V (3S Li-ion)
PWM frequency: 15–16 kHz
Control method: Sign-magnitude drive using two logic signals (A and B)

MOSFETs Used
High side (P-channel): IRF9540
Low side (N-channel): STP100N6F7
Gate drive transistor: 2N7000
The high-side and low-side MOSFETs use identical discrete gate drive circuits built around a 2N7000 (no dedicated gate driver IC).

Gate Drive & Timing
Hardware dead-time implemented using a 15 nF capacitor on the 2N7000 gate (high-side).
1N4148 diodes added to reduce switching power losses of high side and low side mosfet.
Each half-bridge is controlled by one PWM signal.
During operation, one side is PWM’d while the opposite side is held at constant logic level.
High-side and low-side MOSFETs require opposite gate polarities to switch, and so a single signal was used to drive both together. 

Load Details
Motor current (no load): ~100 mA
Expected loaded current: Higher (robot drive application)

Testing Performed
Before assembling the full H-bridge, I tested:
High-side P-channel MOSFET + gate drive independently
Low-side N-channel MOSFET + gate drive independently
Rise and fall times appeared sufficient for 15–16 kHz PWM operation.
Each device switched correctly when tested separately.
However, when assembling the complete H-bridge, it did not function at all.

MCU Failure During Testing
While testing one half-bridge (left), I accidentally removed the gate resistor between the stm32 pwm pin and the gate of 2N7000.
After this event, the STM32 micro-controller blew, it became really hot, and there was a short on the pwm pin, vdd and ground.
I suspect one of the following:
1.Excessive current injection into MCU pin
2. Or a Voltage transient spike due

Current testing Plan
I plan to test incrementally:
1.Test a single diagonal conduction path (top-left P-channel + bottom-right N-channel) with motor attached.
2.Test one half-bridge at a time. Measure the gate voltages, drain voltages, and current under the real motor load. Then Reassemble the full bridge only after validating each section. Is this a good idea?
But before doing any testing I want to know if there is some circuit that I could use to protect my mcu pins. Just in case something happens again.
Questions
1. Design Review - are my designs good, like anything glaring issues with the design. My problem is that my testing did not take into the account the back emf voltage from the motor, so, it is not certain what the voltage value is a the source of the P-channel (high side) mosfet - and so, not 100% if applying 11.1V at the gate will actually cause the mosfter to switch on/off. The second problem I see is that both the gates of each half h bridge are connected to same pwm pin, which might be a problem?

2. MCU Protection: I bought a cheap ESP32 instead of another STM32. What protection methods would you strongly recommend to prevent MCU damage during testing, of course I will try not to make mistakes but in case of some voltage spike, I do not want my esp32 damaged. Are there any good circuits for this?

extra info:
I do not know why the isolated h-bridge leg did not work. I first decreased, and then removed the gate resistor, as the voltage levels from my on my gate were not reaching proper levels (3.3V, 0V), and I thought this was due to resistors dividing the voltage. I know why the MOSFET blew, most likely current injection or voltage spike, but I do not know why it was not working before I removed the gate resistor.
Load profile is a motor, 22ohm internal resistance, 22mH of inductance (measured it). I do not know what other details are relevant, so I am adding a pic of the datasheet of the motor.
I am pwm'ing one leg of the h-bridge, and keeping a constant signal on the other leg of the h-bridge. The high side needs high signal to close, the low side needs a low signal to close. So I decided to connect the pwm signals to each leg of the mosfet (the third picture in my post shows how the pwm signals are connected to the h-bridge)
 

Offline MoFlavorTopic starter

  • Newbie
  • Posts: 5
  • Country: za
please someone help I am student and beginner, are my diagrams not good enough or too confusing for this forum
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 6071
  • Country: au
    • send complaints here
Gate Drive & Timing
Hardware dead-time implemented using a 15 nF capacitor on the 2N7000 gate (high-side).
As connected that capacitor is slewing both high+low drivers identically, probably making shoot through worse. Drive each of the 4 fets with a separate PWM channel so you can control dead time in code.
 

Offline MoFlavorTopic starter

  • Newbie
  • Posts: 5
  • Country: za
okay thank you, looking at it now that cap is also not providing any dead time which was my intention as it is connected to the input signal
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 698
  • Country: pl
The use of capacitor C1 overloads the microcontroller's GPIO. The delay time depends not only on R1 and C1 but also on the internal resistance of the GPIO, which is likely greater than R1. The RC circuit delays both edges, and the bridge transistors receive the same waveforms, so it will not work as dead-time. Check the maximum currents for GPIO. The losses in the R3 resistors will be high, up to 2W.

Why did you decide to build a MOSFET driver using discrete transistors?

Using a IC driver is simpler; you need to have specific arguments to do it the hard way, especially if you don't know how.

For fun, I once designed a half bridge driver without capacitors, that generates dead-time using the bipolar transistors long storage time (1us). It works in simulation, but I don't see the point in someone building such a complicated circuit (4 - 6 transistors) for such a simple function.




« Last Edit: March 05, 2026, 11:14:14 am by MariuszD »
 

Offline MoFlavorTopic starter

  • Newbie
  • Posts: 5
  • Country: za
The main reason to use a mosfet driver is because my uni labs do not have driver IC's (they are out of stock for bjt's), but they had the 2n7000 mosfets for free, so was trying to be cheap. i lookaed at surrounding stores and none have them gate drivers, they have full h-bridge IC's.
I am thinking to use opto-isolators for each driver to protect the gpio pin, and the added benifit as that I can connect a capacitor to add dead time on the collecter/emttier side... well that's the idea, I'm going to simulate it in ltspice to see if it's feasible.
For the R3 resistor I think I have to increase it's value, and therefore increase rise/fall times of the high side/low side mosfets, and so the h-bridge won't be able to function at high frequencies (pwm< 10kHz) and will be only be able to operate on 30-70% duty cycle.
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 698
  • Country: pl
For the R3 resistor I think I have to increase it's value, and therefore increase rise/fall times of the high side/low side mosfets, and so the h-bridge won't be able to function at high frequencies (pwm< 10kHz) and will be only be able to operate on 30-70% duty cycle.
R3 can be replaced with a transistor circuit. See the schematic below. It's better to use BJT instead of M2.

Deadtime must delay the rising edge for the low-side transistor and the falling edge for the high-side transistor.  Asymmetric edges can be achieved by shunting the resistor with a diode. After the RC circuit, one edge will rise slowly, so a Schmitt trigger will be useful.

I made the dead-time circuits on 4093 or 74HC14.
« Last Edit: March 06, 2026, 02:20:35 pm by MariuszD »
 

Offline MoFlavorTopic starter

  • Newbie
  • Posts: 5
  • Country: za
thank you I never thought of using a diode that way.

my current understand of that driver circuit is: when M1 is closed the current flows from R1 to ground, and the gate of m2 uncharged. If M1 is open, then the gate of M2 is charged, as the diode and M1 prevents any current flow. Current flows to M3, but also through D1, then back to the gate of M2, and through R1? so is the current flowing back to the voltage source when M2 is charged?

Also when M3 needs to discharge, that current is also flowing through back to the gate of M2?
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 698
  • Country: pl
Think not only about the current but also about the voltage. When M1 is off, the current R1 does not flow, and there is 12V at the gate of M2. Current can flow to the gate of M3, but the voltage at point "a" must be lower than 12V for the current to flow. 2N7000/2N7002 starts conducting at 2V Vgs, so at point a it will be 10V for 12V supply, and the diode will be reverse-biased. If instead of the 2N7000 a bipolar NPN (BC337, S8050) were used, the voltage at point A could rise to 11.4V, making the circuit closer to ideal.

When M1 is turned on, the gate capacitance of M3 will be discharged by D1, the Vgs voltage of M2 will be -0.6V, so it will be turned off.

Quote
Also when M3 needs to discharge, that current is also flowing through back to the gate of M2?
The voltage at the gate of M2 is lower than at the source.

Example of diode usage in a schematic. The second schematic shows an improvement due to the use of BJT.


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->