Issue in driving opamp as comparator to drive mosfet - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: May 19, 2020, 07:54:23 am
content: 1. I have MCU operating at +5V, and need to drive a mosfet with Vgs = 10V-12V.2. Freq to drive is 20Khz around ie 50us on and 50us off.3. I was looking for low cost solution and MCU dircetly cannot give that much vgs to mosfet so I used opamp LM358 in between. as in ckt below.Issue is I am getting triangular output?There may be some freq limitation, but opamp datasheet says it has 1Mhz unity gain?What I am doing wrong in it.4. Attached is ckt output in simulation , same is seen in actual hardware.

author: Benta
author_rank: Super Contributor
timestamp: May 19, 2020, 09:32:00 am
content: An op amp not really suitable as comparator. You'll have issues with saturation and it can take quite some time for the amp to recover. The 1 MHz you refer to is only valid for linear operation.Use a real comparator chip instead.

author: rstofer
author_rank: Super Contributor
timestamp: May 19, 2020, 05:48:11 pm
content: Or look for a Logic Level MOSFEThttps://arduinodiy.wordpress.com/2012/05/02/using-mosfets-with-ttl-levels/Check carefully if the low gate voltage will keep up with the 20 kHz speed. The turn-on and turn-off times may be longer than those of the older MOSFETs. Or not...MOSFET heating occurs in the transition region, keeping it short makes sense. In the case of PWM, the idea is to use a lower frequency such that the transition time is a small percentage of the cycle time. At some frequency, the MOSFET will never get out of the transition region and it continuously heating. Well, it is always heating but much less once fully conducting.

author: Zero999
author_rank: Super Contributor
timestamp: May 19, 2020, 10:01:15 pm
content: You're using the wrong IC for the job. An op amp will not do. Even directly driving it directly from the microcontroller is better than using an op-amp. Ideally you need a MOSFET driver IC. Examples include the MCP1416, ICL7667 and MCP1407.http://ww1.microchip.com/downloads/en/DeviceDoc/20002092G.pdfhttps://www.renesas.com/cn/en/www/doc/datasheet/icl7667.pdfhttp://ww1.microchip.com/downloads/en/DeviceDoc/20002092G.pdf

author: magic
author_rank: Super Contributor
timestamp: May 20, 2020, 09:25:51 am
content: Quote from: Vindhyachal.takniki on May 19, 2020, 07:54:23 amQuote from: Benta on May 19, 2020, 09:32:00 amThat's not saturation, saturation would be the output "sticking" to a rail for a while after the inputs have changed.This is slew limiting. You observe slew rate of roughly 10V per 25µs, which is about 0.4V/µs, as it should.Real comparators have faster slew rates, real gate drivers have faster slew rates and higher output currents.

author: Benta
author_rank: Super Contributor
timestamp: May 20, 2020, 03:17:24 pm
content: Quote from: magic on May 20, 2020, 09:25:51 amNo, I meant what I said. When overdriving an op amp you'll have saturation in one or more of the internal stages. Saturation as in one or more transistors saturated, not just the output ones. This is of course dependent on op amp model/type, but it's certainly outside linear operation.

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: May 24, 2020, 02:03:32 pm
content: But didnt datashhet says "Wide Bandwidth (Unity Gain): 1 MHz"?1. If 1Mhz is not freq to which it can operate, then what parameter define what max freq opamp will work fine?2. Otherwise why 1Mhz is mentioned?3. Any low cost opamp/comparator which can work on this? If 8 pin posssible then its better, as I have already designed PCB for it , pin to pin compataible would be good

author: Zero999
author_rank: Super Contributor
timestamp: May 24, 2020, 03:33:57 pm
content: Quote from: Vindhyachal.takniki on May 24, 2020, 02:03:32 pmIt's not a matter of whether the op-amp will work or not, at over a certain frequency. In reality, the LM358 will be useless at much lower frequencies, than 1MHz.1MHz is the unity gain bandwidth which is the frequency when the gain falls to 1, i.e. when the output voltage equals the difference between the two inputs. If you're using the op-amp to amplify a voltage, the op-amp's gain, at the maximum frequency of interest, needs to be considerably higher than the closed loop gain of your circuit. For example, if you need a gain of 10, you want the op-amp to have a gain of well above 100, at the upper cut-off frequency.The slew rate is how quickly the op-amp's output voltage can change, over a specified period of time. If an op-amp has a slew rate of 0.4V/µs, it means the fastest the output voltage can change over 0.4µs is 1V, so for it'll take 10/0.4µs = 25µs for the output voltage to change from 0V to 10V, which will be the minimum rise/fall times of any squarewave it can output.QuoteThe answer really is none. You chose the wrong IC and should use aMOSFET driver, as I mentioned in the other post.You might find a comparator with a push-pull output will work, but it'll still be fairly slow, compared to a proper MOSFET driver.What package style is you LM358? Is it through hole or surface mount?I had a quick look through Digi-Key and the only part I can fine which is available in both SMT and through hole and works up to 12V is the TLC3702.http://www.ti.com/lit/ds/symlink/tlc3702.pdf?HQS=TI-null-null-digikeymode-df-pf-null-wwe&ts=1590334161646

author: magic
author_rank: Super Contributor
timestamp: May 24, 2020, 04:32:44 pm
content: Quote from: Benta on May 20, 2020, 03:17:24 pmI don't know, I suspect most of the time saturation would still result in rail sticking rather than limited slew rate. Besides, the slew rate seen here is exactly as expected due to compensation.I have used TLC3702 to drive a power MOSFET similar to IRFZ44N once. It worked but I don't remember switching times. I think a few µs maximum.Quote from: Vindhyachal.takniki on May 24, 2020, 02:03:32 pmIt will output 1MHz just fine but only at a low amplitude such that peak slew rate doesn't exceed 0.3~0.5V/µs. Increase amplitude to 10Vpp and it will struggle with 100kHz, perhaps even 10kHz. Those chips are notoriously "slow". But hey, they are cheap