Electronics > Beginners
Op Amp as comparator not behaving as expected
(1/3) > >>
Peeps:
I wanted to use an op-amp to buffer a 0 to 5V 25khz PWM signal. I thought this would be simple: Put a 2.5V reference on the -v input and run my pulse signal into the +v input but I was so wrong.

LTSpice tells me it should work fine. The op-amp is an LF412CN. The math makes sense. Vout = A(v+ - v-), so when the pulse is > 2.5V the output should go high and when its <2.5 it should go low. Instead the output just stays high. In fact heres what I found after a lot of head scratching:

In the non inverting config, when my reference voltage is between 0 and 5V the output stays high. Beyond 5V the output follows the input. It's like completely backwards.

If I reverse the pins, so its in an inverting configuration, the output follows the input for vref of 0.7V to 2.0V. Then from 2 to 5V the output stays low, then beyond 5V it goes high. Only the last part makes any sense to me.

My op-amp is being supplied single rail, 12V.

tron9000:
that doesn't sound like a buffer, that sounds like a comparator.

Diagram? If you have it in LTspice then its a screenshot away.
Peeps:
Heres the schematic. It will be driving a PMOS but for the sake of testing I've taken it out.
Zero999:

--- Quote from: Peeps on May 11, 2018, 07:42:58 am ---I wanted to use an op-amp to buffer a 0 to 5V 25khz PWM signal. I thought this would be simple: Put a 2.5V reference on the -v input and run my pulse signal into the +v input but I was so wrong.

LTSpice tells me it should work fine. The op-amp is an LF412CN. The math makes sense. Vout = A(v+ - v-), so when the pulse is > 2.5V the output should go high and when its <2.5 it should go low. Instead the output just stays high. In fact heres what I found after a lot of head scratching:

In the non inverting config, when my reference voltage is between 0 and 5V the output stays high. Beyond 5V the output follows the input. It's like completely backwards.

If I reverse the pins, so its in an inverting configuration, the output follows the input for vref of 0.7V to 2.0V. Then from 2 to 5V the output stays low, then beyond 5V it goes high. Only the last part makes any sense to me.

My op-amp is being supplied single rail, 12V.

--- End quote ---
This is not an op-amp buffer but a comparator circuit.

Of course this won't work. The common mode range of the LF412 is being exceeded, resulting in phase inversion, i.e. the functions of the inverting and non-inverting pins exchanging. The LF412 needs both of its inputs to be around 3V above the negative rail to work properly, otherwise it will behave erratically.

The LF412 is completely the wrong IC for this application. Apart from the common mode range issue, stated above, it's too slow and can't provide enough output current to charge/discharge the MOSFET gate quickly enough. Use a proper MOSFET driver, such as the MCP1416 or MC33152.
Peeps:

--- Quote from: Hero999 on May 11, 2018, 09:55:40 am ---
--- Quote from: Peeps on May 11, 2018, 07:42:58 am ---I wanted to use an op-amp to buffer a 0 to 5V 25khz PWM signal. I thought this would be simple: Put a 2.5V reference on the -v input and run my pulse signal into the +v input but I was so wrong.

LTSpice tells me it should work fine. The op-amp is an LF412CN. The math makes sense. Vout = A(v+ - v-), so when the pulse is > 2.5V the output should go high and when its <2.5 it should go low. Instead the output just stays high. In fact heres what I found after a lot of head scratching:

In the non inverting config, when my reference voltage is between 0 and 5V the output stays high. Beyond 5V the output follows the input. It's like completely backwards.

If I reverse the pins, so its in an inverting configuration, the output follows the input for vref of 0.7V to 2.0V. Then from 2 to 5V the output stays low, then beyond 5V it goes high. Only the last part makes any sense to me.

My op-amp is being supplied single rail, 12V.

--- End quote ---
This is not an op-amp buffer but a comparator circuit.

Of course this won't work. The common mode range of the LF412 is being exceeded, resulting in phase inversion, i.e. the functions of the inverting and non-inverting pins exchanging. The LF412 needs both of its inputs to be around 3V above the negative rail to work properly, otherwise it will behave erratically.

The LF412 is completely the wrong IC for this application. Apart from the common mode range issue, stated above, it's too slow and can't provide enough output current to charge/discharge the MOSFET gate quickly enough. Use a proper MOSFET driver, such as the MCP1416 or MC33152.

--- End quote ---

Well thats very interesting, thanks...I was hoping to just use whatever I had laying around here to make this circuit. I tried a bunch of different op-amp models in LTSpice and they produced the desired results but I guess the simulation isn't good enough.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod