Author Topic: Another Power Supply  (Read 30427 times)

0 Members and 1 Guest are viewing this topic.

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #25 on: February 02, 2016, 09:05:38 am »
mij59/Kleinstein - OK, I think I understand most of that. I understand what you're saying about the current sense resistor position, that makes a lot more sense. I think for my simple design I'll move it to the low side and accept the penalty load there. In terms of the floating regulator, is the main benefit that you don't need to go through the attenuate/amplify steps to get the feedback to the right level to pass through the op amp? That makes sense as well, although I'll need to try and get my head around how the regulator would then be able to regulate to a voltage below the floating level... if that makes sense. I'm planning to rework this design and keep it simple, but the floating regulator idea sounds great for the next version....


SteveP - Thanks for the advice, I appreciate it :) I think everything you're saying is where I saw myself for version two. I deliberately left my scope broad for this version because I didn't know what I didn't know - I could put a bunch of specifications on it but I don't have the experience to know if they're realistic or even useful. I fully expect that I'll make many mistakes while I build this, but at the end of the day it'll only really be used for playing around and testing out ideas. And if it doesn't work at all, then I get to learn how to debug the hardware properly. My only real aim was to produce something that "works" based on the ideas of Dave's circuit, without directly copying it.

As for input/output protection, that's definitely something that I've left out. Like I said, I was never expecting this design to last (which is why I left it out) but the more I think about it, the dumber that idea seems...

Thanks again!
 

Offline mij59

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: nl
Re: Another Power Supply
« Reply #26 on: February 02, 2016, 09:44:56 am »
For controlling the output voltage it makes no difference what the internal reference point is, with the floating regulator it only means the regulator has to control a negative voltage with respect to the reference point. 
 

Offline SteveP

  • Contributor
  • Posts: 24
  • Country: us
Re: Another Power Supply
« Reply #27 on: February 02, 2016, 03:58:04 pm »
Brad,

Re the "I don't need standards/goals", you'll have them implicitly even if you don't make them explicitly. Here's why:

You will, presumably, test your first board. OK, what tests will you perform? You'll connect it up to some test circuit to see if it powers it. That circuit will eventually be more than a resistor--it will be something realistic which means it won't draw constant current (that's how you test whether it regulates or not) and the test circuit will have some capacitance (most realistic things do). The un-constant-ness  of your test circuit  will be, by default, your "standard". At some point you *must* answer the question, "does it regulate well enough to be usable?" and therein lies your standard, even if it is established by a series of test cases rather than an explicit decision.

I very much agree with the approach of doing something relatively simple and getting that to work just to understand the issues. In my case I left off the pre-regulator and anything to do with a micro. I think you'll find that you'll have your hands full just keeping it from oscillating when presented with anything like a realistic load. I can tell you that if keeping *one* opamp from causing oscillation has a difficulty of N, then keeping two from oscillating is probably ten times harder. That means you probably need to start with just your pass device and an amplifier for voltage regulation (no current limiting). 

The problem (that you don't know about yet) is that power supplies (or anything with a feedback circuit) can be unconditionally stable, conditionally stable, or completely unstable. The first case you don't have because of your choice of pass device. So it will either be completely unstable (oscillate) or will be stable depending on what load you put on it (not just how *much* load, but what *kind* of load). If the latter, then if you test it on a couple of simple loads (purely or mostly resistive) and it works,  you'll *think* its stable and usable right up until the time you ask it to power a project and your project misbehaves, possibly  frying something. Then you'll go nuts debugging the project because you won't find any obvious problem with it--the reason being it was the power supply misbehaving that's causing the problem, possibly frying things in the process.

What you probably don't know yet is that oscillation can create *large* voltage swings. If you're using it to power a 3.3v project, and the oscillation creates 10v swings (even when you set it for 3.3v), what do you think will happen to your 3.3v parts?

So you can't get by with saying "I don't know what standards to use" (not if you want to stay sane). You have to decide at some point "this is the envelope this supply will be good for--anything outside the envelope it may be unstable, anything inside I can count on". If you don't want to go to the trouble of simulating something before you build it, then I strongly suggest you make up a board with just the candidate pass device and voltage regulation amplifier, leave plenty of room around the amplifier for resistors and capacitors, and start playing. See if it oscillates right off the bat. If it doesn't, then present it with some varying loads--vary the load's resistance, slowly at first, then quickly. Make sure the thing doesn't oscillate. Most real digital projects will have a bunch of 100nF bypass caps--those are typically low ESR and they're in parallel (if you think about it), which lowers the total ESR. So be sure you test with something like that, too. If it *still* doesn't oscillate, then, and only then, move on to getting current limiting to work.

There is a saying: "amplifiers oscillate, oscillators don't". You have some amplifiers in there... draw your own conclusion :-)
--Steve

 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14072
  • Country: de
Re: Another Power Supply
« Reply #28 on: February 02, 2016, 06:04:09 pm »
The floating regulator has mainly 3 advantages:
1. The circuit is very flexible, as the OPs don't need to move there output all the way up and down. So essentially the same circuit, with just a few resistors adjusted and suitable transistors can work for a 3 V regulator or a 900 V regulator. The regulator with emitter-follower gets more complicated once you go beyond about 30 V, as the OP needs to give the full swing.

2. The maximum output voltage can come rather close to the available input voltage, it's just the drop of the pass transistor. So one can expect something like 1-2 V lower required input supply.

3. Current limiting is usually rather fast - this can be a problem with other designs.

The main disadvantage is the need for the auxiliary supply, and for a beginner may be the confusion about having the ground not at the negative output.

So with a 20 V range one can still use the emitter follower type regulator. If you don't need a fast regulation this type can also get away with a rather slow feedback and thus a simpler design: the emitter-follower takes care of the high frequency part and the extra feedback circuit mainly acts below about 10 kHz.
Having the shunt at the low side does not prevent the regulator from compensating the drop at the shunt (at least at low frequencies) - so this does not compromise performance. The main disadvantages are:
One can not have two regulators using the same raw supply.
Current limiting tends to be slow and one may need a second resistor for a fast limit at the high side as well.

The real difficulty in a lab supply is getting it stable with any reasonable load. The critical loads to test are very low esr capacitors (about 100 µF and about 10000 µF range) together with a constant current sink. It's usually a good idea to use a simulation to check the design for stability (here it is easy to get zero ESR caps), though the final circuit may behave a little different.
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #29 on: February 03, 2016, 07:45:16 am »
OK I think I get most of that - the bit that I'm struggling with is how you would integrate the floating regulator with a variable power supply? I totally get for a fixed output it makes perfect sense, but the only idea I can come up with in my head is by using a variable pre-regulator - so the pre-reg always gives you say Vout + 3, then you can run the opamp from Vout + 3 down to say Vout - 2 (so a 5v float), then regulate +/- 2v from Vout - 2 to Vout + 2, which avoids operating up to the opamp rail and keeps the whole circuit consistent. I still don't get how to create the accurate voltage reference though?


Steve - Thanks again, I appreciate the advice. I'm reasonably comfortable with control theory from a mechanical/aeronautical perspective, it's the implementation in electronics that I'm not familiar with. I'd have no idea how to derive a transfer function for a regulator circuit (as an example), and that's something I definitely aim to learn this year.
On the simulation - I've been deliberately avoiding simulation because I've had some bad experiences with it in the past. Admittedly it's been a few years since I've used SPICE but I seem to remember it being way more complicated to use than I thought it needed to be and most parts took a lot of guessing parameters that weren't in datasheets (which kind of made it all redundant). Saying that, I think you're right, I probably do need to put in the effort to learn simulation.
On the current control - ironically (coming from the guy whose power supply basically has no protection ::)) the main reason I wanted current control on this design is safety... I thought that without it, a small mistake would mean a big boom. You've hit the nail on the head though, my biggest concern for this design is whether the voltage regulator opamp and the current control opamp "play nicely".
And on what I planned to use this for - I probably wasn't really clear before. I don't really plan to use it to power any future designs. That's version 2. This one would basically be to "play" with... so learning Kicad, building a library of code that works on the i2c display and controlling the output with the uC. I planned to first hook it up to a resistor, looking to see if it worked under a stable load. Next test would probably be current control - so short circuit and see that it current limits properly. After that, I'd either look at more complex loads or use what i had so far with what I learnt to build it and attack version 2. In reality my plan was to try and make it fail - then work out what I did wrong that caused it. That information would then be fed to make something better.
I do appreciate the advice though, it's making me rethink how I want to approach this. Thanks :)
 

Offline mij59

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: nl
Re: Another Power Supply
« Reply #30 on: February 03, 2016, 09:43:29 am »
OK I think I get most of that - the bit that I'm struggling with is how you would integrate the floating regulator with a variable power supply? I totally get for a fixed output it makes perfect sense, but the only idea I can come up with in my head is by using a variable pre-regulator - so the pre-reg always gives you say Vout + 3, then you can run the opamp from Vout + 3 down to say Vout - 2 (so a 5v float), then regulate +/- 2v from Vout - 2 to Vout + 2, which avoids operating up to the opamp rail and keeps the whole circuit consistent. I still don't get how to create the accurate voltage reference though?

The pre-regulator is used to limit the power dissipation in the linear regulator ( actuator ),  a transistor of some kind.
For pre-regulator you could use : -  switch mode power supply
                                                            -  transformer with several voltage taps
                                                            -  (as I am  using )  phase angle control

There's no law that states you must use a pre-regulator, in you case you don't really need one.

The input voltage of the linear regulator must all way’s be higher than the output voltage , a linear regulator can only regulate voltage downward.

For a reference voltage  you could use a zener diode, or  a of the shelf part like the ADR4540.
The accuracy of the voltage reference is not important, things like temperature drift an long term stability are more important parameters. 


 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #31 on: February 03, 2016, 10:13:46 am »
Yeah sorry, I wasn't too clear on that one either - my pre-reg is gone for this design, I'm thinking of version 2 :)

I'm still a bit confused on how the floating regulator works but I'll search for a few designs and have a think about it. Thanks again for your help!
 

Offline rqsall

  • Regular Contributor
  • *
  • Posts: 87
  • Country: nl
Re: Another Power Supply
« Reply #32 on: February 03, 2016, 12:28:37 pm »
OK I think I get most of that - the bit that I'm struggling with is how you would integrate the floating regulator with a variable power supply? I totally get for a fixed output it makes perfect sense, but the only idea I can come up with in my head is by using a variable pre-regulator - so the pre-reg always gives you say Vout + 3, then you can run the opamp from Vout + 3 down to say Vout - 2 (so a 5v float), then regulate +/- 2v from Vout - 2 to Vout + 2, which avoids operating up to the opamp rail and keeps the whole circuit consistent. I still don't get how to create the accurate voltage reference though?


Unless I'm missing something (I'm also still researching for my first power supply project) it's explained in AN 90 from HP: http://www.delftek.com/wp-content/uploads/2012/04/HP-power-supply-handbook.pdf
 

Offline SteveP

  • Contributor
  • Posts: 24
  • Country: us
Re: Another Power Supply
« Reply #33 on: February 04, 2016, 03:14:17 am »
Hey Brad,

Re simulation: I just checked and I installed LTSpice on October 25, 2015. I simulated pretty much 6-8 hours/day from then until about 15 January 2016 (I'm retired, so I get to do stuff like that :-)). That's a lot of hours of simulation and it would have been a lot *more* hours if I'd been getting actual components to work. Lots of folks here use LTSpice so that's what got me going on it. I run it on Linux under Wine. I figured it would be a pain to install or run, but it wasn't. I was doing useful work the first day. It has a graphical user interface which makes it fairly convenient to use.

I can say with some authority that it's easy to get lost in the weeds with a project like this. For instance, you'll get to a point where you *think* you have stable voltage regulation, so you add current regulation. You then find it oscillates like crazy. You think it's something to do with what you just added so you spend a week tinkering with compensating the current error amp. Then you wake up and realize, no, the instability was always there in the voltage regulation circuit, you just never ran quite the right test to provoke it. A little wiser, you rip out the current amp, make the voltage amp more stable, and repeat. Several times. Finally you wind up with a list of "all the ways this thing can be unstable" (your test suite). You realize that if you'd had that test suite to begin with you could have done the past month's work in a day or two.

I can also say with some authority that most of your time will be spent in the upper right hand corner of the schematic. The rest, comparatively speaking, is easy.

I understand that you're not planning to "use" the power supply. But you still have to decide if it works. OK, getting it to not oscillate will be an achievement and that could be a definition of "it works". But, really, I think you're going to want to know "does it really regulate?" To do that, you're going to present it with a *changing* load of some sort just as a test--that is the definition of regulation. When the load changes, does the voltage stay the same? If not, how much does it change?  And what will be the characteristics of that load? Any capacitance? How fast will the load change? You can stop at any point and call it "good". You can decide that if it gets the voltage back to within 1% of the starting point that it's "good enough". You might decide that it's good enough if it doesn't produce a spike of more than 10% when the current demand drops from 0.5A to 0.01A as long as it doesn't fall faster than 1A/ms.

The essence of a bench power supply is that it regulates voltage when faced of a variety of loads. If it can't do that, it ain't a power supply :-)  How *well* it does that is what you get to decide as the designer. So even though you don't intend to actually use it, you still need to understand the basic types of loads a power supply must handle and ensure that yours handles them, at least in some fashion.

As far as compensation goes, you're ahead of where I was when I started. I had no idea about the issues of feedback and what transfer functions were. Here's a good start for you on the electronics side of things:

www.ti.com/lit/an/snva020b/snva020b.pdf
www.ti.com/lit/an/slva662/slva662.pdf

I read each one about 97 times :-) Plus there's more I'll pass along when you get the point where you need it....
--Steve
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #34 on: February 04, 2016, 09:01:28 am »
rqsall - Thanks, I appreciate the reference. Added to my bookmarks to read before starting on the next version :)

SteveP - All right, you've convinced me :) I'm about two thirds of the way through redesigning this version based on the feedback I've gotten here. Fingers crossed I'll have something by the weekend. I'll post it back here when I'm ready to begin simulation.
I have to say though, I wish I was retired - a normal work week for me varies from about 60-100 hours. It gets easy to put hobbies off until you get a spare moment, but I've been forcing myself for the last few months to spend a couple of hours four nights a week working on designs. So far so good - it's a great experience. And thanks for the links, I'll read these ones soon! :)
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #35 on: February 04, 2016, 11:20:04 am »
OK I have something I'm happy to start simulating for Rev B1. I've simplified the 4.096V supply, rechecked components and added some trial compensation to the voltage/current op amps. I put a small LPF on the output of the current sense differential amp for when the load varies rapidly. I feel a lot more confident about this design than the first one, now I just need to get it into SPICE and see how it goes. Thanks again to all for your help!
 

Offline mij59

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: nl
Re: Another Power Supply
« Reply #36 on: February 04, 2016, 12:09:23 pm »
Can't wait to see the simulation results  >:D
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14072
  • Country: de
Re: Another Power Supply
« Reply #37 on: February 04, 2016, 04:21:08 pm »
The plan under RevB1 has several flaws. The current regulating OP will not work at low output voltages - the supply will go down too. So it would need something like a negative auxillary supply. Its usually easier to have the shunt at the low side as this avoids the large common mode voltage swing. It easier to compensate for the small voltage drop at the shunt, that the large swing of the output.

Also combining the voltage and current regulation will not work this way: having the two small transistors in series gets closer to giving the maximum of the two controls - what you need is something like the minimum of the two control signals. This could be achieved with two transistors in parallel with the collectors - though this type of circuit has some difficulties, as the transistors provide quite some gain.
Also the sign of feedback looks wrong for the voltage feedback.

The current has to much filtering, making it very likely oscillate.
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #38 on: February 05, 2016, 04:34:05 am »
Can't wait to see the simulation results  >:D

Oh dear... that sounds foreboding  :D  :-BROKE

The plan under RevB1 has several flaws. The current regulating OP will not work at low output voltages - the supply will go down too. So it would need something like a negative auxillary supply. Its usually easier to have the shunt at the low side as this avoids the large common mode voltage swing. It easier to compensate for the small voltage drop at the shunt, that the large swing of the output.

Also combining the voltage and current regulation will not work this way: having the two small transistors in series gets closer to giving the maximum of the two controls - what you need is something like the minimum of the two control signals. This could be achieved with two transistors in parallel with the collectors - though this type of circuit has some difficulties, as the transistors provide quite some gain.
Also the sign of feedback looks wrong for the voltage feedback.

The current has to much filtering, making it very likely oscillate.

Is there any problem providing source voltage for the regulator amps from the high side but leaving the sense resistor on the low side?

For the transistors, makes complete sense, I imagined them in my head "fighting" but I didn't even think of putting them in parallel - will change.

For the voltage feedback, I have the reference voltage in the + input and the feedback voltage in the - input. Is this the wrong way around? My labelling is ambiguous - V_OUT is the voltage out from the DAC, V_IN is voltage into the ADC. I'll change them to V_DAC and V_FB in the next revision.

On the filtering - are you talking about R5/C11 or R7/C14? And do you mean they shouldn't be there at all or the values are too high? I added R7/C14 because I was worried at a 50x gain on the current sense, a small current difference would be amplified, so a very small current change would continually drive the amp from Vs to ground repeatedly, which would cause more oscillations. In my head, I associate filtering with mechanical damping, which would remove oscillations - is this incorrect?
Thanks again! :)
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14072
  • Country: de
Re: Another Power Supply
« Reply #39 on: February 05, 2016, 10:08:47 am »
For the Filtering C14 should not be there at all as it causes too much phase shift. R7 is still needed for the following stage (C11*R7). The gain of the amplifying stage is rather high as it could limit the speed of the OP - so better use a larger shunt. Often one can get away without the extra stage at all. The value of C11 is rather high (usually more in the 100pF-10n range), but that is a minor detail.

The output stage with the transistors is inverting, so the voltage feedback need to go to the + input.
With only 20 V voltage range I would usually avoid an output-stage with gain and better use just a darlington stage. Its much easier to have the gain in the regulating OP only.

Having the shunt on the low side also has an disadvantage: the current regulator needs a rather high gain to reduce the output voltage. However this depends also on the type of output stage. This often makes it slow and thus an additional fast current limit is helpful. Having the current regulator floating has some advantages and can give better performance , but it usually needs some effort for the supply (e.g. negative supply to provide a minimum current even at low voltage, transfer of the setpoint to the floating regulator). Having the negative supply to provide a minimum current to the power transistor is a good idea anyway.
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #40 on: February 05, 2016, 10:58:16 pm »
For the Filtering C14 should not be there at all as it causes too much phase shift. R7 is still needed for the following stage (C11*R7). The gain of the amplifying stage is rather high as it could limit the speed of the OP - so better use a larger shunt. Often one can get away without the extra stage at all. The value of C11 is rather high (usually more in the 100pF-10n range), but that is a minor detail.

The output stage with the transistors is inverting, so the voltage feedback need to go to the + input.
With only 20 V voltage range I would usually avoid an output-stage with gain and better use just a darlington stage. Its much easier to have the gain in the regulating OP only.

Having the shunt on the low side also has an disadvantage: the current regulator needs a rather high gain to reduce the output voltage. However this depends also on the type of output stage. This often makes it slow and thus an additional fast current limit is helpful. Having the current regulator floating has some advantages and can give better performance , but it usually needs some effort for the supply (e.g. negative supply to provide a minimum current even at low voltage, transfer of the setpoint to the floating regulator). Having the negative supply to provide a minimum current to the power transistor is a good idea anyway.

Thanks again - last night I read the app notes that Steve provided above and I can see now trying to come up with a mechanical "equivalent" was a bad idea... I didn't take phase shift into account, which makes sense now. I thought the high gain on the amp would reduce accuracy (by amplifying the noise) but I didn't realise it would slow the amp - I'll move the shunt back upstream and increase the size. The value on C11 was a pluck based on the idea "more damping = more stable" but I can see now that's not necessarily true - this will be a prime target to play with in simulation.

The darlington makes sense - replaces Q5 and Q4 and is directly driven by the voltage comparator opamp. I'll put the current control and enable in parallel from the last post. I want the current control to sink the excess current when it limits, so I'll keep that as an NPN.

On the polarity - I can't get the logic to work in my head? If the output voltage is high, then the - input will be greater than the + input, driving the amp output low, which for the NPN darlington would reduce current flow and then reduce the emitter current/voltage... is that correct?

Thanks again - I feel like I'm (slowly) getting there. Hopefully will have something simulated today :)
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #41 on: February 06, 2016, 04:33:01 am »
Alright, I've had a bit of time today and made a little progress. The schematic has been updated to RevB2 with all the suggestions. I've also managed to get the circuit into LTSPICE and have some results from there.

First up I modeled the 24VAC filtering and 5.1v supply:



And it actually worked  :D  The ripple is a lot less than what I calculated but if that's realistic then I'm pretty happy :)

Next I managed to get the rest of the voltage regulator circuit in with models from the component supplies, and as much as I'd like to say it worked first time, this thing oscialltes worse than Oprah's diet  :o



And that's just with a 120ohm load! Next step - fix it... here comes the fun part  >:D

For reference, blue is the load voltage, green is the voltage from the voltage opamp, red is voltage from current limit opamp, aqua is voltage from enable line and for stamps, purple is the current through the voltage opamp output.
« Last Edit: February 06, 2016, 04:36:04 am by braddrew0 »
 

Offline mij59

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: nl
Re: Another Power Supply
« Reply #42 on: February 06, 2016, 05:48:35 am »
I would like to see a magic smoke generator function implemented, using 1N4148 diode's as rectifiers is not realistic.
Referring to the fist simulation, the ripple voltage depends on the load current.
In the second simulation you need to add the suggestions made by Kleinstein.
The behaviour of the power supply at power up will be just one of the challenges, for now the control circuitry is more important.
Just some remarks concerning schematic,  R12 will restrict the range of the output voltage, the voltage sources I_DAC and V_DAC need a series resistor, the power enable function doesn't work.

 

Offline SteveP

  • Contributor
  • Posts: 24
  • Country: us
Re: Another Power Supply
« Reply #43 on: February 06, 2016, 04:37:54 pm »
OK, now yer talkin! :-)

First, I think you're still trying to deal with too much stuff all at once (been there, learned the hard way).

I'd cut the circuit back to just a voltage regulating op-amp (and compensation components). Get that to not oscillate & get it to regulate semi-decently. Then try it with a semi-rapidly changing load. When that works, add a 1uF cap (not low ESR) to the output load and get that to work. Keep upping the capacitance to say a 100uF or so. Then try adding some low ESR caps -- say 1uF with .01 ESR (or lower, if you're up for a challenge). When you've got all that working, THEN you might tackle the current regulation.

Learning about power supplies is proportional to the difficulty of the load you get your circuit to regulate. That's why it's important to not stay in the "shallow end" of the pool.

I get the part about not having a lot of hours...that's why it's important to do this stuff in a better order than I did it in :-)

Also, I can't quite read the schematic to see what transistor you're using, but at some point, before you invest too much effort in your opamp/pass device combination, you'll want to check that your pass device can handle the 40 watts you're going to throw at it. R theta j-c and all that. Most BJTs aren't great at dissipating heat--that's one of the things that drives designs towards MOSFETs.

Congratulations on your progress this far--I'm impressed!
--Steve
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14072
  • Country: de
Re: Another Power Supply
« Reply #44 on: February 06, 2016, 06:06:32 pm »
Even for a relatively simple circuit, like the voltage regulator without current limiting there are to many parameters to change to get to a good solution just by try and error. Here it might help to take a look at commercial available supplies or application notes about voltage regulation.

An important property to look at in simulations is the output impedance. One can get this quite easy from simulations, by using a AC current source as a load.  It is important that the phase shift will not be larger than 90 degree, as this would mean there is a load to make it oscillate.

It is also a good idea to keep the circuit simple - a more complicated circuit usually needs longer to get back to equilibrium.

Also don't try to optimize to much - if you need to tweak values to tight tolerance, the circuit is not practical and easy to disturb by parasitic effects.
 

Offline SteveP

  • Contributor
  • Posts: 24
  • Country: us
Re: Another Power Supply
« Reply #45 on: February 06, 2016, 06:21:10 pm »
Just to be clear, I am not suggesting trial and error. Rather, simplify the circuit so when the material on compensation is read and partially understood, there is not so much to deal with. Once the *idea* of compensation is grasped, then we can work on getting LTSpice to tell him some useful info about his circuit (Bode plot). Once he's done a bit of that, then a more rational approach can be undertaken. But he's a ways from that yet, I think.
--Steve
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #46 on: February 07, 2016, 01:12:40 am »
Did someone say bode plots?  :D

I took all of your advice and broke it down to the most simple circuit I could, which was the voltage regulator opamp with a constant voltage source input. That helped me remove a few of the obvious flaws (references in the incorrect sense, bias to the base of the pass transistor which wasn't needed, and no output cap - massive fail!) and I think I have a reasonable solution. When I had the regulator functioning correctly, I generated my first bode plot for a 100 ohm load:



I'm not sure if you can see it but there's about 30 degrees phase margin there, so a solid starting point :)

Next I varied the resistor and looked at the plot. The phase margin stayed around 30 degrees up to around 10K, and then I tried reducing it. Strange things started to happen as I got really low - at 1.6 ohms it was perfectly stable, but then below about 1.6 ohms I couldn't get a 0dB figure as the circuit would attenuate the signal at all frequencies. I did a transient analysis and saw it was struggling to meet the 20V requirement (as I got a smaller load, the output voltage decreased), but it was stable and there was minimal oscillation in the output. I thought this might have been due to output attenuation, so I played around with the voltage divider resistors - sure enough, at their original values (40K/10K) the minimum load was higher (around 1.9 ohms). I'm a bit hesitant to go smaller because I'm worried about their effect on the current sense but I'm happy with where it's at now.

So then on to caps - I tried 1uF with 2 ohm ESR, then 10uF, 100uF and 1000uF with no problems. I dropped ESR progressively to 0.001 ohms and here's the result:



Phase margin has increased up about 55 degrees :)  The transient output showed a really stable signal - which has me thinking that maybe the addition of a second, low ESR cap on the output might help me out? My only concern is that it will modify the transfer function and make the system unstable in some other regime - but it's on my list of things to try.

I'm not too sure how to simulate a variable load (I played with the varistor function but it wouldn't work for me). Instead, I imagined that the person operating the unit turned the voltage control knob from zero to max - twice a second constantly :D  I set the V_DAC source to a 2VAC + 2VDC sine wave, and got this output:



I don't think it comes across here, but apart from not quite hitting 20V on the first couple of peaks, it's an almost perfect sine wave from 0-20V   :-DMM

So I'm reasonably happy with the basic voltage control, at least to the level I know how to test it now. Next step, I added the rectified AC signal as the voltage input. I tried making a transfer function using the same methodology as before, but for some reason it told me that every signal would be attenuated by like -80dB where transient analysis gave me a reasonable solution? Regardless, I started with a 100 ohm load and got this:



That seems usable to me :) I varied the load, and again the high resistances were fine, but this time the output was attenuated (and ripple got quite high) below about 9 ohms. And here it is driving 9 ohms:



Again, I think that's usable :) Next step, caps. Unless I'm doing this wrong, it seems to handle the low ESR caps well? This is 1uF with 0.001 ohm ESR:



That's the graph that's making me think of adding the second cap in parallel. Next step, I tried to add in the enable transistor. Taking on board the advice about it not working, I went for an NPN between the output of the voltage regulator opamp and the base of the pass transistor. This stopped the circuit from working completely. I'm starting to lean towards maybe just setting 0V on V_DAC to disable, although I don't think this is a great solution... when I simulated it, I still got about 820mV output. I don't want to use a relay on the output but I might keep investigating this and see if there are any other options.

My final test was looking at the low voltage setting with a low resistance load. Based on the 0V test, I gave it 1V output at 9 ohms:



Still not too bad, it's <20 mV throughout.


So that's where I am now. I'd appreciate any suggestions of other tests I can throw at it, otherwise next test will be the second output cap and then on to current control.

To hit all the feedback I haven't answered so far-

mij59 - I agree on the diodes, it just gave me something to work with (rather than a stable power supply). I kind of thought that at the end of the day, individual component tolerances would mean that the only real way to test was to build it and pull out the scope.

Was there a specific thing that Kleinstein mentioned that I didn't catch? The only two I've deliberately stayed away from are the floating regulator and the negative supply for the current control amp - both good ideas, but I think they will over complicate this specific circuit? I did misinterpret the opamp driving the pass transistor but I think I have that fixed now :)

R12 is gone and I've added resistors for the DAC outputs, thanks :) Also not sure what to do on the enable - I'd really like it in there but it depends on whether or not 820mV is good enough for "off". Maybe when I add the current limit it will drain some of that and lower it further - I might just wait and see. Either way, thanks again :)

SteveP - First up, thanks for the app notes, that first one was the "light bulb" moment for converting what I already knew into something that would work. On the pass transistor, it's an ONSemi NJD35N04G Darlington NPN (http://www.digikey.com.au/product-detail/en/NJD35N04G/NJD35N04GOS-ND/1484392). 20V-2A is within the safe DC operator area and as-is (DPAK case) it should function to an ambient temp of around 40 degrees C. I plan to add in extra cooling though - first, I'll give it a patch (>1 square inch) of ground on both sides of the board with thermal vias. I worked out this should give me around 2W (5 degrees) of cooling. Second, I'd like to use a surface mount heatsink (specifically - http://www.digikey.com/product-search/en?mpart=573100D00000G&v=59). This should give me another 3W or so. So running 20V-2A constantly will technically work up to maybe 45-50 deg ambient (at which point I stop to function :D) or the parts will last longer when run at lower ambient temps and power settings. Thanks again!

Kleinstein - I haven't looked at output impedance yet, do you mean of just the regulator or the whole circuit? Is there a figure I should be aiming for? Obviously the lower the better, but what's "good enough" for a simple regulator like this? And yup, the app notes are great, I've found it seems to be a lot about finding the ones that explain concepts in a similar way to how my brain works... Thanks again for all your help :)
« Last Edit: February 07, 2016, 01:15:58 am by braddrew0 »
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #47 on: February 07, 2016, 03:58:20 am »
Quick short update - tried both adding the smaller cap and also a variable resistor as load. Small cap made a very small difference so I'll leave it out. The variable resistor (I used a value of R=9+10000*time) didn't really affect the output much.

I also tried massively increasing the initial filter cap (to 470000uF) but it made very little difference.
« Last Edit: February 07, 2016, 04:10:10 am by braddrew0 »
 

Offline mij59

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: nl
Re: Another Power Supply
« Reply #48 on: February 07, 2016, 06:21:54 am »
Quick short update - tried both adding the smaller cap and also a variable resistor as load. Small cap made a very small difference so I'll leave it out. The variable resistor (I used a value of R=9+10000*time) didn't really affect the output much.

I also tried massively increasing the initial filter cap (to 470000uF) but it made very little difference.

The filter cap is not part of the control loop, so it should not make a difference.

For best performance current sensing use a  floating regulator or use low side sensing.
Add a transistor to Q1 make a darlington.
I you want to use high side current sensing, put the resistor in series with the emitter of Q1.
 

Offline braddrew0Topic starter

  • Regular Contributor
  • *
  • Posts: 79
  • Country: au
Re: Another Power Supply
« Reply #49 on: February 07, 2016, 07:48:24 am »
Yeah I'll definitely go floating on the next one, simpler for this version not to worry about it at the moment. Current sense will be low side. And Q1 is a Darlington - I could only find one Darlington in the LTSPICE library and it wouldn't let me change the model? I just used the NPN picture and a custom Darlington model.

Thanks! :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf