Author Topic: Oscillation in PSU simulation  (Read 4181 times)

0 Members and 1 Guest are viewing this topic.

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Oscillation in PSU simulation
« on: April 17, 2020, 08:36:34 am »
Hi, I'm a hobbyist and trying to "design" a lab PSU;

I tried adding RC filter between inverting and output of both op amp with different values (trial and error) but haven't had any luck getting it to not oscillating, before giving up thought maybe you guys can point me at right direction.

Connecting the inverting input of the op amp (voltage feedback) directly to the output stops the oscillation but still oscillates in CC mode, but connecting it to the differential op amp which measures the voltage causes oscillation both in CC and CV mode.

Is it a bug in the simulator? how can I stabilize the output?

Link to the simulator: http://tinyurl.com/yancfgls
« Last Edit: April 17, 2020, 08:39:15 am by ElectronSurf »
 

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2873
  • Country: au
Re: Oscillation in PSU simulation
« Reply #1 on: April 17, 2020, 08:48:57 am »
Just a capacitor between output and inverting input of the CV op-amp should work. 10nF should be overkill. Then reduce it.
Maybe the same for the CC side.
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #2 on: April 17, 2020, 08:59:23 am »
You can click on the simulator link and try it yourself, it doesn't fix it...
 

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2873
  • Country: au
Re: Oscillation in PSU simulation
« Reply #3 on: April 17, 2020, 09:19:45 am »
A resistor is needed in series with the inverting input of the CC op-amp for a compensating capacitor to be effective.
I was seeing large amounts of noise on the scope. It cleared up after I removed and added the scope again.
« Last Edit: April 17, 2020, 09:21:31 am by xavier60 »
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #4 on: April 17, 2020, 10:08:16 am »
When you reset the scope you have to right click on the scope and choose "max scale" to be able to see the noise, the oscillation is still there.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19749
  • Country: gb
  • 0999
Re: Oscillation in PSU simulation
« Reply #5 on: April 17, 2020, 10:11:17 am »
There are too many op-amps. You only need two: one for current and one for voltage. Putting two amplifiers inside one loop like that is asking for oscillation.

I've removed the unnecessary op-amps and it's more stable, but there's still noise, even when 10nF is used for the compensation capacitors, so I don't think it's oscillation, probably an artifact of the simulator. By the way, it's drawn backwards, the convention is to start with the input (power source) on the left and the output (load) on the right.


http://tinyurl.com/y7fmlfnm
« Last Edit: April 17, 2020, 10:39:22 am by Zero999 »
 

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2873
  • Country: au
Re: Oscillation in PSU simulation
« Reply #6 on: April 17, 2020, 10:33:41 am »
I think it's a simulator problem. Turning off Max Scale always hides the problem.
By probing certain points on the output wire shows no problem.
And it's stable with no compensation.
What is the Max Scale setting for?
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #7 on: April 17, 2020, 10:36:22 am »
That's what I wanted to know, is it the simulator or there's really oscillation.

Max scale zooms in to the signal.

I have to learn to use ltspice, this isn't working...
 

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #8 on: April 17, 2020, 10:42:10 am »
I noticed that you bold the link to simulation, the oscillation is still there and I'm coming to conclusion that the noise is from the simulator...

« Last Edit: April 17, 2020, 10:46:49 am by ElectronSurf »
 

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2873
  • Country: au
Re: Oscillation in PSU simulation
« Reply #9 on: April 17, 2020, 10:45:05 am »
Your circuit in practice should be easy to compensate.
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 
The following users thanked this post: ElectronSurf

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #10 on: April 17, 2020, 10:49:43 am »
Yeah I have to build it on breadboard and test it out. the problem is I don't have a decent oscilloscope to analyze it in depth. just a cheap chinese one, that's why I was trying to use a simulator...
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19749
  • Country: gb
  • 0999
Re: Oscillation in PSU simulation
« Reply #11 on: April 17, 2020, 10:58:03 am »
That's what I wanted to know, is it the simulator or there's really oscillation.

Max scale zooms in to the signal.

I have to learn to use ltspice, this isn't working...
Yeah I have to build it on breadboard and test it out. the problem is I don't have a decent oscilloscope to analyze it in depth. just a cheap chinese one, that's why I was trying to use a simulator...
Yes, I noticed the link could easily be missed, so I went back and enlarged it. In that case, it's just noise i.e. rounding errors in the simulation. You'll often see similar things in real life, when zooming in on a signal very closely, especially with a digital oscilloscope. What oscilloscope do you have? Some of the cheap Chinese ones are perfectly decent.

The circuit you originally attached appears to oscillate and experience tells me it's likely to do so, because it has two amplifiers in each loop, especially as one of them is open-loop. Sometimes this is a necessary evil, or it's is just easier to design that way, but in this case it isn't: you've already got a current source going to the base of the Darlington pair and ORing diodes, so you might as well connect the output of each amplifier to each of them.

Why is LTSpice not working? I know it depends on what one is familiar with, but I find it infinity easier to use than that falstad simulator, which made me curse and swear after a few minutes of editing your schematic. If it was in LTSpice, I would have been able to mirror it, with the input to output going left to right, but there doesn't seem to be a way to do that with falstad, without redrawing it. :palm:
 
The following users thanked this post: ElectronSurf

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #12 on: April 17, 2020, 11:10:36 am »
The scope is DSO138, it's a toy. I didn't say ltspice isn't working, I meant the falstad isn't working and I have to learn ltspice.

For current sensing I ordered INA128 in-amp so I thought it's better to simulate it as a simple differential amplifier for now. and to be able to measure the voltage remotely I'm going to need another in-amp which I'm planning to home-brew it with three OP07. do you think having two in-amp and two op amp is going to oscillate because of the loop you mentioned? (the keyword is "hobbyist", this guy (me) don't know anything about electronics)
« Last Edit: April 17, 2020, 11:13:47 am by ElectronSurf »
 

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2873
  • Country: au
Re: Oscillation in PSU simulation
« Reply #13 on: April 17, 2020, 11:38:07 am »
If a loop oscillates, add a compensating capacitor as already shown. The more stages there are in a loop, the more likely it will be unstable.
You can experiment with the value to see what works ok. Too large a value for the CV loop wont matter much because the output stage is naturally voltage sourcing.
You don't want the capacitor to be too large for the CC loop because the PSU will be too slow too respond to large overloads.
Many designs have extra circuitry for fast current limiting.
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 
The following users thanked this post: ElectronSurf

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #14 on: April 17, 2020, 11:57:15 am »
Many designs have extra circuitry for fast current limiting.

Isn't what I implanted fast? can you please show me an example?
 

Online xavier60

  • Super Contributor
  • ***
  • Posts: 2873
  • Country: au
Re: Oscillation in PSU simulation
« Reply #15 on: April 17, 2020, 12:05:09 pm »
In this example, Q5 monitors the voltage across the CS resistor. Its Collector can draw drive current away from the Darlington's Base.
https://www.eevblog.com/forum/projects/how-to-design-fast-bench-supply-with-cc-and-cv/msg3018424/#msg3018424
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 
The following users thanked this post: ElectronSurf

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Oscillation in PSU simulation
« Reply #16 on: April 17, 2020, 12:15:15 pm »
I think the 2 improvements have created a problem where the +5V current setting reference voltage is no longer referenced to ground ?
.  That took much longer than I thought it would.
 

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #17 on: April 17, 2020, 12:19:54 pm »
In this example, Q5 monitors the voltage across the CS resistor. Its Collector can draw drive current away from the Darlington's Base.
https://www.eevblog.com/forum/projects/how-to-design-fast-bench-supply-with-cc-and-cv/msg3018424/#msg3018424

Sorry for asking unrelated questions to the topic; does op amp slew rate plays a role in fast switching to CC mode too?
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19749
  • Country: gb
  • 0999
Re: Oscillation in PSU simulation
« Reply #18 on: April 17, 2020, 12:39:58 pm »
The scope is DSO138, it's a toy. I didn't say ltspice isn't working, I meant the falstad isn't working and I have to learn ltspice.

For current sensing I ordered INA128 in-amp so I thought it's better to simulate it as a simple differential amplifier for now. and to be able to measure the voltage remotely I'm going to need another in-amp which I'm planning to home-brew it with three OP07. do you think having two in-amp and two op amp is going to oscillate because of the loop you mentioned? (the keyword is "hobbyist", this guy (me) don't know anything about electronics)
Why do you want to use an instrumentation amplifier? They're not designed to be used in a loop like that. There's certainly no point with the voltage amplifier, just use precision resistors and a low offset/bias current op-amp. The internal matched resistors inside an instrumentation amplifier make more sense, for the current amplifier, but precision matched pairs of resistors can be used with the op-amp circuit I posted if you want better performance.
https://www.mouser.co.uk/ProductDetail/Vishay-Thin-Film/ORNTA50-1T0?qs=sGAEpiMZZMvrmc6UYKmaNbqQAD9%252BUsfF3rw6ojp5gC0%3D
https://www.mouser.co.uk/ProductDetail/Vishay-Thin-Film/AORN100-1AT5?qs=sGAEpiMZZMvrmc6UYKmaNV6xYUiB84CiwIR2BTir2S8%3D


In this example, Q5 monitors the voltage across the CS resistor. Its Collector can draw drive current away from the Darlington's Base.
https://www.eevblog.com/forum/projects/how-to-design-fast-bench-supply-with-cc-and-cv/msg3018424/#msg3018424

Sorry for asking unrelated questions to the topic; does op amp slew rate plays a role in fast switching to CC mode too?

Yes. When switching from one mode to another, the op-amp must swing from close to the positive rail, all the way down to just above whatever the output voltage is supposed to be. For example, suppose the output is set to 20V, the voltage amplifier's output will be somewhere around 21.5V and the current amplifier's output will be saturated, as close to its positive rail, as it can. When the output is short circuited, the current amplifier's output will have to rapidly drop down to 1.5V or so, whist the voltage amplifier's output shoots all the way up close to its positive rail. This takes time and a large current will flow. When the short circuit is removed, there will be some voltage overshoot.

Here's a link to a simulation of a circuit, showing the current and voltage overshoot. Note that it's not very stable and will oscillate with a capacitive load, because the current amplifier is within the voltage amplifier's loop: U1 pulls down U2's inverting input, via a diode.
https://www.eevblog.com/forum/projects/how-to-design-fast-bench-supply-with-cc-and-cv/msg3007168/#msg3007168

Diodes can be added to clamp the op-amp's output voltage to the inverting input, just limiting the output rate of change and is discussed in the thread linked to above.
 
The following users thanked this post: ElectronSurf

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #19 on: April 17, 2020, 01:23:38 pm »
I wanted to use in-amp to measure the current accurately (0.1 mV/16 bit ADC) at the high side of circuit. unfortunately I couldn't find any seller who sells thin film resistors where I live, so the only option is to use a simple voltage divider or an in-amp/differential amplifier. is there a third option? can I compensate for the created loop instability somehow?

About the op amp slew rate; does JFET op amps speed makes them a good solution for lab power supply application?

This for example: https://www.analog.com/media/en/technical-documentation/data-sheets/OP249.pdf
« Last Edit: April 17, 2020, 01:37:40 pm by ElectronSurf »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19749
  • Country: gb
  • 0999
Re: Oscillation in PSU simulation
« Reply #20 on: April 17, 2020, 01:51:07 pm »
I wanted to use in-amp to measure the current accurately (0.1 mV/16 bit ADC) at the high side of circuit. unfortunately I couldn't find any seller who sells thin film resistors where I live, so the only option is to use a simple voltage divider or an in-amp/differential amplifier. is there a third option? can I compensate for the created loop instability somehow?
Why not simply use an ordinary op-amp for the current amplifier and an instrumentation amplifier to monitor the current?

Quote
About the op amp slew rate; does JFET op amps speed makes them a good solution for lab power supply application?

This for example: https://www.analog.com/media/en/technical-documentation/data-sheets/OP249.pdf
Whether it's J-FET or BJT makes no difference to the speed of the op-amp. J-FETs don't draw any current through their gate junctions, so J-FET op-amps have lower bias currents and a higher input impedance than BJT input devices. BJTs are essier to make with matched characteristics, than J-FETs so BJT input op-amps have lower input offset voltages, than J-FET op-amps, although modern J-FET devices are very good.
 
The following users thanked this post: ElectronSurf

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #21 on: April 17, 2020, 02:04:04 pm »
Why not simply use an ordinary op-amp for the current amplifier and an instrumentation amplifier to monitor the current?

Because I'm thinking of implanting an current/voltage set mode before enabling the output, using two different op amps one for measuring and displaying and another for current amplifier makes a little bit of difference between the user input and actual output.

I haven't had any luck at high side current sensing with an general purpose op amp without adding another op amp (two op amp in-amp) and even that introduced a lot of error. though this only is my thoughts/trial errors and I don't have any experience, just sharing it with you to come up with a solution...
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19749
  • Country: gb
  • 0999
Re: Oscillation in PSU simulation
« Reply #22 on: April 17, 2020, 04:50:24 pm »
Why not simply use an ordinary op-amp for the current amplifier and an instrumentation amplifier to monitor the current?

Because I'm thinking of implanting an current/voltage set mode before enabling the output, using two different op amps one for measuring and displaying and another for current amplifier makes a little bit of difference between the user input and actual output.
I don't see how you'll be able to do this without using separate amplifiers. One of the control amplifiers will always give a false reading. When it's in current mode, the voltage amplifier will be saturated at the positive rail, thus be giving a false reading and the current amplifier will do the same, when it's in voltage mode. I suppose you could just ignore the reading from the amplifier which is pulling the ADC out of range and assume the current or voltage is equal to the value set, depending on the mode.

Quote
I haven't had any luck at high side current sensing with an general purpose op amp without adding another op amp (two op amp in-amp) and even that introduced a lot of error. though this only is my thoughts/trial errors and I don't have any experience, just sharing it with you to come up with a solution...
What circuits have you tried?
 

Offline ElectronSurfTopic starter

  • Regular Contributor
  • *
  • Posts: 80
  • Country: 00
Re: Oscillation in PSU simulation
« Reply #23 on: April 17, 2020, 06:54:23 pm »
I don't see how you'll be able to do this without using separate amplifiers. One of the control amplifiers will always give a false reading. When it's in current mode, the voltage amplifier will be saturated at the positive rail, thus be giving a false reading and the current amplifier will do the same, when it's in voltage mode. I suppose you could just ignore the reading from the amplifier which is pulling the ADC out of range and assume the current or voltage is equal to the value set, depending on the mode.

But the values is not going to be readen from the control op amps, voltage using voltage divider at the output and current from current sensing in-amp output.

Quote
What circuits have you tried?

Differential amplifier with 1% resistors is not giving any meaningful output, two op amp in-amp gives a value close to actual current passing through the shunt resistor and with an "home-brew" in-amp I was able to get current reading with ~ ±1mA error.
« Last Edit: April 17, 2020, 06:57:38 pm by ElectronSurf »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19749
  • Country: gb
  • 0999
Re: Oscillation in PSU simulation
« Reply #24 on: April 17, 2020, 08:08:20 pm »
I don't see how you'll be able to do this without using separate amplifiers. One of the control amplifiers will always give a false reading. When it's in current mode, the voltage amplifier will be saturated at the positive rail, thus be giving a false reading and the current amplifier will do the same, when it's in voltage mode. I suppose you could just ignore the reading from the amplifier which is pulling the ADC out of range and assume the current or voltage is equal to the value set, depending on the mode.

But the values is not going to be readen from the control op amps, voltage using voltage divider at the output and current from current sensing in-amp output.

Quote
What circuits have you tried?

Differential amplifier with 1% resistors is not giving any meaningful output, two op amp in-amp gives a value close to actual current passing through the shunt resistor and with an "home-brew" in-amp I was able to get current reading with ~ ±1mA error.
A 1mA error over what range?

I think I'm with you now. 1% resistors shouldn't be that bad. What op-amp and values did you use?

If you must put the instrumentation amplifier in the loop, then you'll need to add a low pass filter to the error amplifier, otherwise it'll oscillate. I'll post a schematic later, if no one beats me to it.
 
The following users thanked this post: ElectronSurf


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf