mosfet h bridge/code dilemma
mikea
Posts: 283
Duane Degn was nice enough to post this code for r/c controlled dc motors. He used the l293 chip for an h-bridge. I am trying to use p, and n channel mosfets for an h-bridge. The p channel needs a low signal to turn on along with a high signal for the n channel at the same time. I have substituted in the con section for his "wheel2red=20 and wheelblack=21"some binary to turn on/off pins simultaneously to run the halves of the mosfet h-bridge. I cant figure out why it isn't working. Also i cant seem to get the "deadband" wide enough. When i use a bi-colored led to simulate a motor it flickers...i have changed the value for deadband and adjusted the trim on the radio. Any advice would be appreciated. -mike
Comments
DS(on) = 0.021Ω @VGS = 10 V
and down lower on the sheet:
V
GSS Gate-Source Voltage ± 20 V
right now it is only getting 3.3v from the propeller, is that enough to operate correctly?-mike
Quick summary of MOSFET specs:
Vgs max - the breakdown voltage of the gate oxide layer, here +/- 20V - ignore this unless you were planning a high gate drive voltage such as 15V (in which case you'd need to think about protection circuitry).
Vth - the threshold gate voltage for conduction - this varies a lot between devices and is the gate voltage for the device just starting to turn on at a few parts-per-million of full forward current (here 0.25mA) - ignore this, you just need to know it will be fully OFF at Vgs=0V
Rds(on) at Vgs = x THIS IS THE IMPORTANT ONE. At the quoted gate-source voltage the device is guaranteed to be on with the given drain-source on resistance.
Total gate charge - this determines how fast it will switch at a given gate drive current. This will matter if switching fast (above 1kHz or so)
Ids max - max continuous forward current. IGNORE THIS. Yes, that's right, ignore it. Unless you plan on attaching a water-cooled heatsink to the device it will melt before you reach this current. Determine how much power you can afford to dissipate in the device and select one with a low-enough Rds(on) to meet this at the highest load current you will need (I-squared-R). You might want to consider heatsinking options (bigger heatsink means you can use larger Rds(on).
The highest pulsed forward current is useful though if you are switching short pulses. You still need to calculate the average power dissipation though.
The p-channel MOSFET needs 10V of gate drive since its Rds(on) is only quoted at Vgs=-10V
This means you will need a power supply of 10 to 15V, you will need some drivers between the logic signals and the p-channel gates (either NPN common-emitter or n-channel common-source stages), and you'll need to level shift from 3.3V to at least 5V for the n-channel drive.
Pretty much the only easy situation for an n-channel/p-channel H-bridge is when using 5V logic to drive all logic-level MOSFETs. Any other configuration and I'd go for a MOSFET H-bridge driver chip and all n-channel devices. The HIP4081 or FAN7388 spring to mind. These devices handle the dead-time and shoot-through prevention and drive 12V into the gates at high current so you don't have to find logic-level MOSFETs and can switch fast (50kHz say). You will need a 12V supply though (the H-bridge itself can run at any voltage though, within the specs of the driver (for the HIP4081 its 80V, for the FAN7388 its a whopping 600V ...)