OP Amp Mosfet driver not working

Thread Starter

TheoryNeverWorkInPractice

Joined Feb 13, 2024
16
Hi,

I'm trying to power a mosfet on/off depending on output voltage.
But regardless of my configurations it just won't work.
Output is a steady 307mV.

Here's my schematic:
1707824673542.png

The logic is this:
Output > 5V, OpAmp Off => Gate off
Output < 5V, OpAmp On => Gate on

1) One issue is that the opamp output is around 5.8V
How is this even an option? Isn't the sole purpose of an op amp to blast all or nothing?? How is it even possible to settle for a value inbetween Vcc and ground? And to do so without any ripples or dynamic behavior?
2) Maybe this is because the gate voltage is too low to turn the mosfet on? But the source voltage ends up at 300mV instead of Vcc.

There are no ripples or anything dynamic about this circuit.
Anyone got any suggestions?

Oh and sure, I'd like to switch the LM324 for another opamp but have no idea which one. And the generic opamp in LTSpice is complete garbage and has never once worked. All it does is complain about unknown subcircuit.
 

Attachments

Thread Starter

TheoryNeverWorkInPractice

Joined Feb 13, 2024
16
Hi! Thanks for the tip!
Could you supply me with the files for that mosfet? LT spice doesn't come with any custom mosfets included.

Also, my output is suppose to stabilze around 5V, if it's any less the gate should turn on and increase output voltage. How is it possible that it sticks to 3.8V?
 

ericgibbs

Joined Jan 29, 2010
18,835
Hi,
These are from my folders, do you know how to install them, after unzipping.?
E
Also, my output is suppose to stabilze around 5V, if it's any less the gate should turn on and increase output voltage. How is it possible that it sticks to 3.8V?
I will check this out..
 

Attachments

Thread Starter

TheoryNeverWorkInPractice

Joined Feb 13, 2024
16
Thanks!
I know where to put the asy files, altho I already have asy files for nmos, pmos. its the default ones, I dont have to replace those right?

The standard.mos I'm not sure where to place..
 

ericgibbs

Joined Jan 29, 2010
18,835
Hi TNP,
Look at this marked up image, I have chosen a MOSFET with a V turn On of Vto =1.6v
The OPA is in saturation, Vout cannot go higher that Vsupply -1.5V

You could try a rail to rail OPA to replace the LM324 or use a higher that 7.5V supply.

E
EG57_ 1475.png
 

ronsimpson

Joined Oct 7, 2019
3,037
The VCC on U1 needs to be at least 5V above VCC. A Gate of a MOSFET needs to be driven above Source by a voltage of more than the turn on voltage. The Gate to Ground voltage is not important.
 

Ian0

Joined Aug 7, 2020
9,792
1) One issue is that the opamp output is around 5.8V
The maximum output of an LM324 is about 1.5V below its positive supply. 7.2V-1.5V=5.7V
How is this even an option? Isn't the sole purpose of an op amp to blast all or nothing??
How is it even possible to settle for a value inbetween Vcc and ground? And to do so without any ripples or dynamic behavior?
No, you’re thinking of a comparator. The purpose of an op-amp is to vary its output to try to make the voltage on its inputs the same.
2) Maybe this is because the gate voltage is too low to turn the mosfet on? But the source voltage ends up at 300mV instead of Vcc.
You are correct.
Oh and sure, I'd like to switch the LM324 for another opamp but have no idea which one. And the generic opamp in LTSpice is complete garbage and has never once worked. All it does is complain about unknown subcircuit.
If you are trying to make a buck regulator, an op-amp isn’t the best place to start.
 

LowQCab

Joined Nov 6, 2012
4,053
What is this project supposed to do ?
Is this supposed to be an LDO-Voltage-Regulator ?
Where does the ~7.2-Volt Power-Supply come from ?
.
.
.
 

Thread Starter

TheoryNeverWorkInPractice

Joined Feb 13, 2024
16
You could try a rail to rail OPA to replace the LM324 or use a higher that 7.5V supply.
I have a 7.2V battery, and I'm trying to be efficient. So I can't just add a voltage divider before the drain of the nmos to lower it's voltage, because then it will loose alot of power when turned on (having all that current run though an extra resistor isnt very nice).

So I need the mos to be connected to Vcc and still be able to drive it using a comparator/opamp. Is that impossible?


No, you’re thinking of a comparator. The purpose of an op-amp is to vary its output to try to make the voltage on its inputs the same.
They have the same symbol so I always thought it was the same IC just set up differently! Wow. I'm really bad at this :/

So I replaced the opamp with a comparator and now I'm starting to get some sensible results.
1707901994881.png
1707902028182.png
The green is Vout.

So obviously I have issues with oscillations. I tried to mitigate it by increasing my capacitance and inductance but it only slowed the frequency of oscillations..

I really like the circuit that you made @crutschow!
But I don't understand it..

I added C2 (330uF capacitor) on the output and that solved the oscillations!
1707902337574.png

So I don't see why I would need the other components of your circuit?
R2 is a pullup resistor? But I don't need one because I'm using nmos, not pmos, correct?

What does R4 do? Stabilize the output incase of low load resistance? I could just add a resistor between output and ground for that right? Or maybe placing it behind a capacitor makes it draw less current?

The circuit to the left of the comparator is to stabilize the voltage from the battery, correct?
C1,C3 is to reduce noise.
The U2 and other resistors are some kind of high quality voltage divider? Is it really nessecary to have that? My R1, R2 is not enough? Comparators shouldnt draw any noticable current right? So is this simple approach really that bad?

Thanks alot for the input guys, i feel like I'm making finally making some progress on my circuit :)
 

Ian0

Joined Aug 7, 2020
9,792
I have a 7.2V battery, and I'm trying to be efficient. So I can't just add a voltage divider before the drain of the nmos to lower it's voltage, because then it will loose alot of power when turned on (having all that current run though an extra resistor isnt very nice).

So I need the mos to be connected to Vcc and still be able to drive it using a comparator/opamp. Is that impossible?



They have the same symbol so I always thought it was the same IC just set up differently! Wow. I'm really bad at this :/

So I replaced the opamp with a comparator and now I'm starting to get some sensible results.
View attachment 315193
View attachment 315194
The green is Vout.

So obviously I have issues with oscillations. I tried to mitigate it by increasing my capacitance and inductance but it only slowed the frequency of oscillations..

I really like the circuit that you made @crutschow!
But I don't understand it..

I added C2 (330uF capacitor) on the output and that solved the oscillations!
View attachment 315195

So I don't see why I would need the other components of your circuit?
R2 is a pullup resistor? But I don't need one because I'm using nmos, not pmos, correct?

What does R4 do? Stabilize the output incase of low load resistance? I could just add a resistor between output and ground for that right? Or maybe placing it behind a capacitor makes it draw less current?

The circuit to the left of the comparator is to stabilize the voltage from the battery, correct?
C1,C3 is to reduce noise.
The U2 and other resistors are some kind of high quality voltage divider? Is it really nessecary to have that? My R1, R2 is not enough? Comparators shouldnt draw any noticable current right? So is this simple approach really that bad?

Thanks alot for the input guys, i feel like I'm making finally making some progress on my circuit :)
1. You have a phase shift in the feedback loop of 180° (Due to the inductor and capacitor). That is the definition of an oscillator.
2. Your MOSFET is wired as a source-follower. Unless you get its gate voltage more that 5V above VCC, it will never be significantly more efficient than a linear regulator.
 

LowQCab

Joined Nov 6, 2012
4,053
Since it would now appear that this project is supposed to
be a simple Switch-Mode-Power-Supply, ( SMPS ),
why are You trying to re-invent the Wheel ??

There are tons of very efficient, "Single-Chip-Solutions" available
out there such as the "Simple-Switcher" line of Chips.

Or are You trying to see if You can make a Circuit that sorta-kinda works from scratch ?

Are You good at using SMD, ( Surface-Mount-Devices ), or
do You want to keep this project all "Though-Hole" / Perf-Board oriented ?
.
.
.
 

Thread Starter

TheoryNeverWorkInPractice

Joined Feb 13, 2024
16
1. You have a phase shift in the feedback loop of 180° (Due to the inductor and capacitor). That is the definition of an oscillator.
So I guess it's impossible to completely avoid oscillations (since this is a buck converter), but that's fine. aslong as they are small.

2. Your MOSFET is wired as a source-follower. Unless you get its gate voltage more that 5V above VCC, it will never be significantly more efficient than a linear regulator.
Could you explain this abit more? Does it have to do with the miller plateu?


why are You trying to re-invent the Wheel ??

There are tons of very efficient, "Single-Chip-Solutions" available
Indeed. It's for a project where I'm not allowed to use finished chips though. I need to make my own converter using basic components.

I can probably use both SMD and non SMDs, right now my aim is to get a stable schematic, then I can pick out which mos and comparator to use. For resistors and such I intend to use SMDs.
 

Ian0

Joined Aug 7, 2020
9,792
So I guess it's impossible to completely avoid oscillations (since this is a buck converter), but that's fine. aslong as they are small.
if don’t fancy reading Hendrik Bode’s seminal work on stability, published in 1941, then Texas has a very good paper on the stabilityof switched-mode feedback circuits.
https://www.ti.com/seclit/ml/slup340/slup340.pdf
there is a difference between the switching frequency of the power supply and oscillations in the output caused by instability in tephe control loop. If the two frequencies happen to coincide, it usually blows up.
Could you explain this abit more? Does it have to do with the miller plateu?
No, simply the Vgs threshold.The source will always be 3.5V or so lower than the gate. @crutschow ’s circuit avoids this problem by using a P-channel device
Indeed. It's for a project where I'm not allowed to use finished chips though. I need to make my own converter using basic components.
I would think that a switched-mode controller was a basic component! They have been around at least forty years! (78S40 was the first, and it is still available)
@crutschow ’s circuit will work, if you need components simpler tha a 78S40. Another approach would be to make the oscillator out of a 555, and add a feedback loop to control the output voltage. Its advantage would be better control of the switching frequency.
 

crutschow

Joined Mar 14, 2008
34,392
I really like the circuit that you made @crutschow!
But I don't understand it..
It's basically your circuit using a comparator, with a TL431 voltage reference to provide a stable output for changes in the input voltage, a a P-MOSFET for proper high-side switching, and a properly sized output capacitor to smooth the voltage.
 
Last edited:

Thread Starter

TheoryNeverWorkInPractice

Joined Feb 13, 2024
16
I have made some updates to my circuit. Sadly I've discovered that it's instable.
Sure I could just copy some finished circuit built by someone else online, but it's not really the objective of the course. I need to develop and understand my own schematic.

But I've copied the idea of using a diod (D2) for stable voltage into the comparator.

I don't see why I would need to change my nmos. It turns on and off perfectly fine atm, I don't see how a pmos would make it more efficient.

Main issue though, it's unstable.
The LC components create a pole/phase shift that is amplified in the feedback system.
I've completed all the courses for these subjects but still when it comes to real world applications I'm just drawing blanks.

How do I draw a frequency response graph for my schematic and if I did I have no idea how to correct it.
Right now my thoughts are like: If one LC circuit phaseshift 180 degrees I'll just add an identical one in series and the whole thing should do a 360 instead. But that's obviously not how things work.

1707999639721.png

If you had this schematic what changes would you make to prevent it from oscillating like it does?

@Ian0 I read that paper although it only gives solutions to a prefabricated schematic of a buck converter. Not so much general advice.
 

Attachments

Last edited:
Top