H-bridge DC motor driver with OPAMP as gate driver? - Page 1
Forum section: electronics / projects

author: suku
author_rank: Contributor
timestamp: June 24, 2019, 05:21:00 pm
content: I'm designing a circuit where I drive a 12V 500mA DC brushed motor using a H-Bridge MOSFET IC (DMHC3025LSD or really any suitable FET pair).https://hu.mouser.com/datasheet/2/115/DMHC3025LSD-709448.pdfI designed simple opamp based driver circuit that will take a GPIO output from 5V microcontroller and output the gate signals for the FETs.DRIVER_P1, DRIVER_P2, DRIVER_N1 and DRIVER_N2are connected to the microcontroller. Pullup and Pulldown reistors are to make sure that the motor won't start while the microcontroller is in reset state. I will add zener clamps to make sure not to damage the GPIO pin with the 12V.MOTOR+ and MOTOR-are connected to the DC motorVDD+12Vis +12V.VSS+12Vis the Ground for the 12V supply.VREFis 2V.Design goals: Low cost, high reliability operation, reliable supply chain for the components.Will this circuit work well? What are some things to look out for when designing motor drivers? Should I use integrated motor driver chip? I'm looking for any feedback!Thanks.

author: David Hess
author_rank: Super Contributor
timestamp: June 24, 2019, 06:50:50 pm
content: There is nothing inherently wrong with that if you do it right unless you need better performance. Operational amplifiers make slow comparators and they become even slower when driving the relatively high input capacitance of power MOSFETs.The LM324 is tame enough to work well as a comparator if the result is fast enough for you. I would put low value series resistors between the LM324 outputs and the power MOSFET gates to limit the current at the expense of a little bit of speed. In through hole designs, these resistors would also help with layout.If the LM324 does not pull up far enough to its positive supply to completely shut off the p-channel power MOSFETs, then add a pull-up resistor to its output.

author: Benta
author_rank: Super Contributor
timestamp: June 24, 2019, 08:11:34 pm
content: Is this for static drive, or do you intend PWMing the motor?Also, why the diodes? The MOSFETs already have reverse diodes.

author: suku
author_rank: Contributor
timestamp: June 24, 2019, 08:23:20 pm
content: I want to be able to PWM the motor. Does that require any special consideration?

author: Zero999
author_rank: Super Contributor
timestamp: June 24, 2019, 08:30:35 pm
content: Quote from: David Hess on June 24, 2019, 06:50:50 pmBut then that problem could be shifted to the negative side of the bridge.The easiest fix is to replace it with a comparator, such as the LM339 (note the different pin-out) and a pull-up resistor from each gate to +12V.Quote from: suku on June 24, 2019, 08:23:20 pmThe LM324 will not do for PWM. The MOSFETs will switch very slowly, which will cause them to get very hot. You need a proper gate drive IC, such as the TC4468.http://www.farnell.com/datasheets/2124840.pdf?_ga=2.221062353.878591148.1561408095-1107606318.1553553996

author: Benta
author_rank: Super Contributor
timestamp: June 24, 2019, 08:57:53 pm
content: Quote from: suku on June 24, 2019, 08:23:20 pmYes, certainly! What PWM frequency are you aiming for?How fast do you intend to change direction of the motor?Which kind of motor is it (PMDC, of course, but quality, speed etc.)?

author: David Hess
author_rank: Super Contributor
timestamp: June 24, 2019, 09:07:23 pm
content: Quote from: Benta on June 24, 2019, 08:11:34 pmIt is sometimes important to prevent the body diodes from conducting because their reverse recovery time causes shoot through current when the other MOSFET turns on. This is not a problem in all applications.Quote from: Zero999 on June 24, 2019, 08:30:35 pmIt is probably never a problem anyway. I had to find an old datasheet but the LM324 actively pulls up to within 1.2 volts. I thought it was more like 2.5 volts.QuoteI agree; the LM324 will be too slow unless your PWM frequency is only kHz.An LM339 quad comparator with pull-ups driving an NPN transistor and diode class-b output driver could work; an example of this type of driver is shown below. Or an integrated drive like Suku suggests.

author: suku
author_rank: Contributor
timestamp: June 25, 2019, 09:50:47 am
content: Thanks for the feedback guys, will replace the LM324 with something that will provide better drive capability. I'm also investigating the possibility of using cheap stepper motor driver as two channel dc motor driver.

author: Yansi
author_rank: Super Contributor
timestamp: June 25, 2019, 10:41:24 am
content: Another design of a "why not do it properly, if it can't be made improperly" type.For "PWMing" a motor, where there is not a requirement for 100% duty cycle ratio (which rarely is really required), use just a couple of cheap half-bridge drivers, such as IRS2001 or any other from the thousands of similar ones. Done.If you that much need to go even cheaper, then by using a couple of discrete transistors, make the bootstrap driver. 2 transistors minimum per mosfet required to do all the heavy-lifting from 3V MCU up to the high/low side gate.//EDIT: Typos.

author: Benta
author_rank: Super Contributor
timestamp: June 25, 2019, 09:54:44 pm
content: Quote from: Benta on June 24, 2019, 08:57:53 pmYou still haven't answered these questions.If you select logic level MOSFETs for the low side, 74AC04 (2 x 2 in parallel plus inverter before) are perfect for low side drive.For the upper side, static drive is enough for a normal PMDC drive system.

author: Someone
author_rank: Super Contributor
timestamp: June 25, 2019, 11:13:00 pm
content: Quote from: Benta on June 25, 2019, 09:54:44 pmAgreed more information is needed to make better recommendations. For slow switching speeds discrete open collector transistor drivers and pull-ups are completely appropriate. An "old" standard part that can drive both sides is the cmos 4504, but depends on the other performance expected of the whole system.

author: David Hess
author_rank: Super Contributor
timestamp: June 26, 2019, 02:56:03 am
content: Quote from: Benta on June 25, 2019, 09:54:44 pmIf the upper side needed to be PWMed also, then an elevated 74AC04 with a 5 volt zener shunt to control its supply voltage could be fed with a simple low output current level shifter.

author: Zero999
author_rank: Super Contributor
timestamp: June 26, 2019, 08:20:00 am
content: As the motor is only 500mA, BJTs may also be an option

author: Yansi
author_rank: Super Contributor
timestamp: June 26, 2019, 10:13:00 am
content: 500mA motor! Well... could have stated that sooner (or have I missed it?)Use an off-the-shelf H-bridge (with integrated drivers of course), unless pushing for low price badly.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 26, 2019, 01:14:20 pm
content: I really second the integrated solution, something like the Rohm BD6220F or BD6221F. A couple bucks. Integrated protections, dead-time, etc. I wouldn't bother doing that with a discrete approach unless there was an excellent reason.

author: lordvader88
author_rank: Frequent Contributor
timestamp: June 26, 2019, 06:19:09 pm
content: Quote from: David Hess on June 24, 2019, 06:50:50 pmSo if u had a common LM393 comparator vs a common LM358 op-amp as a comp., how much difference is there ?I think I only have a few comparators, I should get a few better ones for special projects.

author: jmelson
author_rank: Super Contributor
timestamp: June 26, 2019, 07:03:15 pm
content: Quote from: lordvader88 on June 26, 2019, 06:19:09 pmThe LM393 has no pull-up transistor, it is not designed to sink more than a few mA ouptut with a pull-up resistor. The FET gate drivers I use from International Rectifier can source close to an amp and sink over 1 amp. You need this to keep the transistors out of the linear region, where they do not perform well.

author: lordvader88
author_rank: Frequent Contributor
timestamp: June 26, 2019, 08:07:11 pm
content: I have a few salvaged motors and controller/driver chips. Now I wish I save more boards. I want to make a few simple things like a remote IR curtain opener and light switch flicker. But not like Doc Brown cooking my breakfast.

author: ahbushnell
author_rank: Frequent Contributor
timestamp: June 26, 2019, 11:43:25 pm
content: There is a problem with the way the MOSFET's are installed. Better check that.Also as other people said opamps are not a good idea.andy

author: David Hess
author_rank: Super Contributor
timestamp: June 27, 2019, 05:54:25 pm
content: Quote from: lordvader88 on June 26, 2019, 06:19:09 pmThe LM339/LM393 comparator is like 200 nanoseconds while the LM358/LM324 will take 12 microseconds just to slew its output *after* recovering from saturation. So 100 times faster is not out of the question.But an LM339/LM393 will require some kind of output driver which might be as simple as the example I gave or more likely an NPN/PNP emitter follower pair with a pull-up resistor.

author: Zero999
author_rank: Super Contributor
timestamp: June 27, 2019, 08:54:16 pm
content: The example shown above is for a device with an open emitter output, which can only pull-up. The LM393 has an open collector output, so the circuit needs to be modified accordingly.

author: Yansi
author_rank: Super Contributor
timestamp: June 28, 2019, 07:07:48 am
content: If you go this far with boosting the output stage, why not simply gtfo with the comparator and replace it with just a single small signal n-mos transistor with much better result?

author: David Hess
author_rank: Super Contributor
timestamp: June 28, 2019, 08:31:57 am
content: Quote from: Yansi on June 28, 2019, 07:07:48 amI assumed there was some issue with the input voltage threshold needing to be more precise than the Vgs of a MOSFET would be.

author: ArthurWozniak
author_rank: Newbie
timestamp: June 29, 2019, 12:40:04 am
content: Hey,Do you consider use DRV family?There are complete solutions for small current DC motors such yoursIf not, IR2104 gate driver is awesomeBest regards,