Did someone say bode plots?
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
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
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
) 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