Project: Amspire's power supply in a PCB - Page 1
Forum section: electronics / projects

author: ivan747
author_rank: Super Contributor
timestamp: February 06, 2013, 07:34:45 pm
content: I designed a board with Richard's power supply design. It is very flexible. You can put two voltages on the voltage and curent control connectors and that sets the output properly. It is lacking a constant current indicator. I designed this so you can run it with only a transformer with rectifier and capacitor and a couple of 10 turn pots, but you can add a tracking preregulator and a microcontroller to this. It is very flexible overall. The supply voltage for the op-amp is separated from the voltage that goes into the pass transistor Q1 so you can implement a tracking preregulator. I am thinking of building one that works at 100kHz with a MC34063. I am also going to add a microcontroller board. I added voltage and current measurement outputs. You can connect these to panel meters or to a microcontroller. I also added an output for the tracking preregulator.This power supply has all the protection features Richard intended plus an extra fuse. Richard made an overvoltage protection circuit in which a MOSFET turned on when the output exceeded 30V. If you connect a high current 40V source you would end up frying this MOSFET in tens of a second. In my circuit the series fuse will blow up. The feedback voltage for the regulation circuit is taken directly after the fuse because the fuse has some resistance that would otherwise affect the output voltage. You should include another 2A fuse on the output of your preregulator or rectifier circuit. If the pass transistor Q1 shorts out, you won't get more than 30V at the output.All the parts have their tolerances and/or part numbers specified and they are as generic as possible. For most semiconductors several replacements are listed. Make sure you read the notes.In its current configuration and depending on your heatsink and wether you use a preregulator or not, I think you could get 20V and 2A out of this. I have a 12V-0-12V transformer laying around, so I am gonna build this eventually.The board can be etched at home. The board measures 5.9"x2.5" or 150mmx65mm. The smallest traces are 1mm or 40mil. Everything is single layer, following Ampsire's philosophy on a very generic power supply you can build at home.Original design:https://www.eevblog.com/forum/projects/general-purpose-power-supply-design-7488/From Richard:QuoteI attached the EAGLE CAD files in the zip file, images for the board and schematic and the board and schematic in PDF format. PDF files named transfer are ready to be printed and produced at home.Suggestions and criticism are welcome.Ivan

author: BravoV
author_rank: Super Contributor
timestamp: February 07, 2013, 02:24:40 am
content: Looks great , thanks for sharing !Btw, in that Richard's thread, he did make a new revision, any reason why you're not using that one ? Also it has CC indicator.The later revision called Mark III ->https://www.eevblog.com/forum/projects/general-purpose-power-supply-design-7488/msg111557/#msg111557

author: ivan747
author_rank: Super Contributor
timestamp: February 07, 2013, 11:52:23 am
content: Well, I hadn't seen Mark 3 for starters. But I see some issues:1st these transistors can only dissipate 0.6W(1w at best) and rely on forced air cooling to dissipate the heat.2nd It seems like this was optimized for use with a tracking regulator. It is using signal transistors and a faster loop without darlington transistors or such. That's good, but as I said before the power that can be dissipated is too low. You cannot use this properly with a rectifier only. 20Vx1A=20W/8=2.5W per transistor.3rd it uses PCB traces as resistors. I don't think consistency will be good etching PCBs at home. Sometimes you don't even know if you are getting 1oz copper or not for example.I was taught that using PNP pas transistors bring stability issues but I trust Amspire.Sure it is a great design, but it won't fit my requirements. I want this to be modular so you can add a preregulator module only if you want.BTW I didn't do mark 2 because as far as I can tell it is incomplete.

author: amspire
author_rank: Super Contributor
timestamp: February 07, 2013, 01:20:53 pm
content: It is great to see some people interested in giving the circuit a go.I did them as an exercise - I have power supplies, but I was after a general purpose module that was very cheap and that I could easily adapt to different needs without redesigning any compensation.O was trying to design a very cheap wide range isolated pre-regulator, and I got close, but there was just too much noise generated by the isolated converter unless I started to make the switcher complex.The reason for the isolated converter is I wanted to be able to have multiple modules with each supply fully isolated. This way I could connect multiple supplies in parallel, in series in tracking and non-tracking mode, or just run them isolated.Non isolated switching voltage converters are much easier to design and have much less noise problems, but I never got around to ordering parts to work on a good solution.Quote from: ivan747 on February 07, 2013, 11:52:23 amCorrect. The regulator circuit was designed to have no more then 4-5V peak from input to output. Even as a pure linear regulator, I was planning of adding a big fat linear preregulator on a heatsink followed by the supply circuit.The thinking is it was easy to scale the preregulator without stability issues, but it is hard to scale a regulator without a redesign for each different set of specifications.I realised with a small modification, I could easily float the regulator circuit, so the same regulator could be made to regulate up to 1000V with full short protection just with a different pre-regulator.The design is still a work in progress, and it is not a high priority right now.But I will be very interested to see the results of anyone who build the circuit.QuoteThat is right - you lose the emitter/source follower inherent regulation that you get with NPN transistors or N-channel mosfets.But you gain low dropout, and excellent transient performance under applied shorts on the load as the PNP transistor is basically driven by a constant base current. Mosfets are lousy under shorted output transients unless you have a fast low impedence gate drive that can apply negative volts on the gate when trying to cope with a short. I do not like a 1A regulator that can produce current spikes over 10A from the regulator if the output is shorted.What I found is that the PNP pass transistors seem to end up with the best performance when driven by a low power-low voltage regulator.QuoteAll the circuits are design exercise rather then production tested designs.I will get back to them one day.Richard

author: blackdog
author_rank: Frequent Contributor
timestamp: February 07, 2013, 07:30:57 pm
content: Hi1eCurrend measuring div amp LM324 is using 100K resistors!!!!Look @ the datasheet for Offset and Bias-Current, BIG errors because of the large values resistors and a bad opamp.2eBefore you make a print, measure the loopgain of both controle loops, Currend and Voltage.If you are happy with the stability with a dynamic load test, then you can start making a print.Info about Dynamic testing of a powersupply...Linear Technology app note.http://www.linear.com/docs/29876Motorola (ON Semi Powersupply handbook)www.onsemi.com/pub/Collateral/HB206-D.PDFTI ( National)www.ti.com/lit/an/snva364/snva364.pdfHappy Reading end kind regarts,Blackdog

author: ivan747
author_rank: Super Contributor
timestamp: February 07, 2013, 09:21:58 pm
content: I will try to do the dynamic load test, but I will build this regardless. My current power supplies are both crap.

author: Thor-Arne
author_rank: Unknown
timestamp: March 14, 2013, 01:21:17 pm
content: Is there any progress for this design?

author: ivan747
author_rank: Super Contributor
timestamp: March 14, 2013, 07:30:03 pm
content: Well, my oscilloscope and handheld multimeters were stolen, my lab is mostly useless right now.I would like to see how it goes if someone tries the layout, and it doesn't work, I will make a sound card oscilloscope if I have to!

author: Thor-Arne
author_rank: Unknown
timestamp: March 14, 2013, 07:45:04 pm
content: Sorry to hear that.I was planning to make it on a breadboard to do some measurements, but I'm out of breadboard at the moment. To many things to try.I'll get back to it when I can free up some space, maybe in a day or two.

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2013, 12:37:32 am
content: Ivan, sorry to hear about the stolen gear. That sucks. I was actually thinking about getting back to making a rough board myself to test it along with a number of ideas I had - like floating the whole regulator so it could regulate up to 1000V if you want. Also the ability to have parallel and series tracking supplies was always part of the plan so I need at least two board to test that out.My solution for higher currents was to make a single board costs peanuts, and for a 3 amp supply, use 3 in parallel with two slave boards tracking a master board.However, at the moment, I am working on another project at home - I want to build some hardware that can calibrate a capacitor reference from a known precision resistor to 5 or 6 decimal places. The concept is based on the quadrature transformer bridge method used in standards labs to cross reference the hall effect resistor standards to the calculable capacitor standards but without the transformer. That is my next two weeks at least filled up.By the way, for anyone trying to build my supply, the lm324 was chosen for a reason other then price and availability - it is fairly unique in that its inputs can withstand over 30V - even when it is powered down. So this supply can happily have a 12v or 24v battery attached to the supply output even when it is off. With any other opamp, you need to find ways to protect the supply and opamp from reverse voltage (like the reversed diode from the output to the supply input cap). I liked the idea that this supply can withstand a reasonable voltage on the output inherently.You cannot replace the LM324 with the supposed LT1014 "equivalent" to get lower offsets. You will just end up with a dead supply. The LT1014 cannot withstand overvoltage on the inputs so it is definitely not an equivalent to the LM324.I was never particularly worried about the opamp offsets. I was going to handle them in the calibration procedure, and I wasn't worried about super accuracy. All I ever wanted was extremely high resolution, but if it can manage 0.1% accuracy that would be good. 1% for current is probably OK.Richard

author: Thor-Arne
author_rank: Unknown
timestamp: March 15, 2013, 01:29:57 am
content: I've been looking at this schematic for hours now.I can't really decide if I'm going to try the version with NPN or PNP transistors.The original design uses 100k resistors on the feedback for U3C, and this design uses 1M resistors.Is this because the shunt resistor is changed from 1R to 0R1 ?Also, I was thinking about the need for using 8 transistors.Would it not be better to use one relatively cheap power transistor (i.e. Tayda has MJE3055 for $0.38 and MJE2955 for $0.4)The cost of making a PCB with room for 8 transistors might be more expensive?I really like the idea of making the boards so cheap that one can parallel several to get more current, perhaps a stackable design would work preferably with identical boards.Using a stackable design would make two of the LM324 unused, is there any alternatives for the LM324?Perhaps single OpAmps?I had a look at the DAC suggestions in the other thread, a bit over my head at the moment but I got that more or less running. It seems like a excellent solution.

author: BravoV
author_rank: Super Contributor
timestamp: March 15, 2013, 01:41:58 am
content: LM358 looks very familiar as per spec with LM324 but in dual configuration instead of quad.Although I'm not sure if it has crazy input capability as 324 like Richard mentioned.

author: Thor-Arne
author_rank: Unknown
timestamp: March 15, 2013, 01:51:48 am
content: I think the LM258 is dual and LM158 is single.They're listed on the same datasheet from National Semiconductor.The LM158 is expensive, 258/358 is about the same for each OpAmp.Just needs to hear the original designers opinion on this.

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2013, 01:56:25 am
content: Quote from: BravoV on March 15, 2013, 01:41:58 amThe LM358 is just the dual opamp version of the LM324 - it is exactly the same.

author: BravoV
author_rank: Super Contributor
timestamp: March 15, 2013, 01:59:17 am
content: There you go, straight from Richard'smouthkeyboard.LM158 or 258 are rarely seen and hard to find, while 358 are plenty & dirt cheap, heck, its even cheaper than 324.

author: EEVblog
author_rank: Unknown
timestamp: March 15, 2013, 02:02:18 am
content: I like the look of the MkIII design, I might to build it up and try it, with single a high power PNP tranny I think.This would be for my higher power battery bench supply rather than low power USB one I'm working on now.Dave.

author: Thor-Arne
author_rank: Unknown
timestamp: March 15, 2013, 02:05:28 am
content: Then that's solved.I'll have a closer look at it tomorrow, to late (early) to start anything now.

author: BravoV
author_rank: Super Contributor
timestamp: March 15, 2013, 02:11:49 am
content: Just fyi, I've "LTSpiced" (is this the right word ?) Richard's Mk III here ->https://www.eevblog.com/forum/projects/general-purpose-power-supply-design-7488/msg111914/#msg111914Make sure you have LM324 model to run the simulation.

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2013, 02:17:12 am
content: Quote from: EEVblog on March 15, 2013, 02:02:18 amIt was designed for stability with a high gain lower power power transistors. The idea is for a linear supply, I could use a pretty simple power transistor circuit as a pre-regulator that could easily be changed for different voltage or power levels without affecting the supply stability.If you try it, you will need to find a high gain power transistor because the drive circuit definitely cannot cope with a 2N2955, and it will be unstable or at least conditionally unstable with a darlington. Even if you find a high gain power transistor, it still might be unstable.My goal was stability even with a very low esr capacitor directly on the supply's output, and when you do this, the phase margins get extremely tight. Many power supplies are actually not stable with a load consisting of only a big low esr capacitor, but the user doesn't know because the cap voltage appears constant. You only know if you look at the regulator output and see an oscillation.Richard.

author: ivan747
author_rank: Super Contributor
timestamp: March 15, 2013, 02:31:04 am
content: I could try simulating the Mk. III power supply with a MC34063 pre-regulator, as that design was intended for that. Let's see how it goesI still want to build the Mk. I board someday, it is very simple and modular. You can use it with a pre-regulator, straight from a rectifier and some caps, battery whatever! You can have digital displays, analog ones, pots (analog or digital), LEDs for status indication or have it all controlled by a microcontroller and an LCD.Mk. III comes closer to Dave's µSupply and your pre-regulator depends on your input voltage, and how you control it depends if you are using a microcontroller or pots. You can probably do a dozen combinations, but they aren't very interchangeable or upgradable as they are in Mk I. It's not that the design is not practical, it is harder to implement, and the design has its benefits.As Sgt. Rock would have said:"Measure twice, cut once"Best RegardsIvan

author: BravoV
author_rank: Super Contributor
timestamp: March 15, 2013, 06:39:19 am
content: Quote from: amspire on March 15, 2013, 12:37:32 amIs there any plan to share this at forum about this project ?.. <drool>...

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2013, 07:23:21 am
content: Quote from: BravoV on March 15, 2013, 06:39:19 amIf you are good.It all comes down to whether I can come up with ways to get the stability and phase accuracy I need without getting too complicated or expensive. I need two sinewaves with a relative amplitude accuracy matching within better the 1 part in 10-5and a phase difference of exactly 90 degrees. Then I need to be able to add to one of the signals a small +/- 90 degrees signal of known amplitude to compensate for the capacitors dissipation factor. I think I am close.The biggest difficulty is not just that I need to generate the sinewaves, but I need a way to verify that the amplitudes and phases are absolutely accurate within 1ppm. If you cannot verify the accuracy unambiguously, you cannot know if the result can be trusted.

author: BravoV
author_rank: Super Contributor
timestamp: March 15, 2013, 07:43:40 am
content: Quote from: amspire on March 15, 2013, 07:23:21 amOf course Richard.<evil grin> .. turning my head over others lining up behind.... "Guys .. since its on me, now I'm your bookie .. !... j/kQuote from: amspire on March 15, 2013, 07:23:21 amOk, these two phrases are beginning to sound scary to me ..Looking forward to see it soon ...

author: BravoV
author_rank: Super Contributor
timestamp: March 15, 2013, 08:59:05 am
content: Quote from: amspire on March 15, 2013, 02:17:12 amIs this kind of transistor good enough ? Say like up to 1 or 2 Amp.

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2013, 10:08:07 am
content: Quote from: BravoV on March 15, 2013, 08:59:05 amIt could be, but it looks a bit slow. It would not be as good as the multiple 2N2097As, but maybe. Are you sure this is not a darlington?What is the power dissipation. I have seen high gain 4W transistors, but not 60W plus.

author: BravoV
author_rank: Super Contributor
timestamp: March 15, 2013, 11:54:09 am
content: Quote from: amspire on March 15, 2013, 10:08:07 amIts not darlington as seen at the chart eg. VCEsat< 0.2V@1A, its one of those weird old Japanese super beta 40W transistor 2SB1299(datasheet).

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2013, 12:20:23 pm
content: Quote from: BravoV on March 15, 2013, 11:54:09 amIt could work, but it is definitely not a transistor I would choose for this particular design due to the requirements I set out from the start - it had to be built from very cheap, commonly available parts. Looking on Findchips.com, there was only one supplier with 36 of the 2sb1299. Now for someone building one supply, that consideration may not matter.It is probably about 10 times slower then the 2N2907A and that does concern me - I was depending on the regulator transistor being fairly fast so that it caused a minimal phase shift. Also, you could only realistically get about 20W out of it, so for a 1A supply, that means 0 to 18V at best. I would still go for my 2n2907A with a linear preregulator instead probably using something like a 2N3055-family transistor. A MJE3055 is $0.65 one off quantity from Digikey. The original 115W device in a TO3 package is $1.80. I am sure with some digging there is a better modern device to use instead - - I probably ideally want a NPN darlington for the pre-regulator.Anyway with the renewed interest, I may have to put my other project on hold, and do a bit more work on this supply. At least to the point where the full concept is out there. I do have most of the parts to build it, so I probably should do so.

author: Rerouter
author_rank: Super Contributor
timestamp: March 15, 2013, 12:25:37 pm
content: amspire, would you happen to know of any reference that describes the stability and phase shift of the various layouts, equally how would i tell how much a transistor shifts phase? would i be right to assume the faster the better in that department?

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2013, 12:33:24 pm
content: I would just start with LTspice simulations. You can look at the delays across individual components and you can get the loop response by breaking the feedback loop with a resistor, and injecting a signal into the loop.Richard.

author: Thor-Arne
author_rank: Unknown
timestamp: March 17, 2013, 07:59:46 am
content: Quote from: BravoV on March 15, 2013, 02:11:49 amI've tried to LTSpice this one to.Failed as I'm not familiar with LTSpice.Any chance for getting a copy of your asc files?

author: BravoV
author_rank: Super Contributor
timestamp: March 17, 2013, 08:31:34 am
content: No need for my circuit ASC file, that is the exact file I'm using right now.Apparently you missed the fine print that I mentioned that you must have the LM324 model available in your library in order to run it. Most LTSpice serious users usually already had it since this op-amp is so popular.Attached below zip'ed LM324 model that has 2 files :1. LM324-NS.ASY -> Put it into your \LTspiceIV\lib\sym\ folder, or your own made sub folder that is under sym\ if you want your \sym folder looks tidy instead of dumping all models in it.2. LM324.MOD -> Put it into your \LTspiceIV\lib\sub\3. While in the LTSpice with the Mk III circuit, delete "all" LM324 op-amps, and replace by adding "again" the new LM324 op-amp by clicking add component to the one that you've just added in the \sym folder, or your own created sub folder at step 1. This is because at the current circuit, the LM324 op-amp is referred to the file LM324-NS.ASY that is placed under different sub-folder in my computer.Hope it sounds not too complicated.Edit : Just re-run it again here and its working, an example plot of the Output voltage that overshoots about 10%, and the U1 op-amp output V(n019) plot.

author: Thor-Arne
author_rank: Unknown
timestamp: March 17, 2013, 09:29:46 am
content: Thanks.I got the LM324 model fromLT-Wiki.That's worked somehow.It's possible that I did something else wrong, cant get any voltage on Vout, but I get current through LOAD.Going to play with it for a while to try to see what I have goofed on.

author: amspire
author_rank: Super Contributor
timestamp: March 17, 2013, 12:52:08 pm
content: Quote from: BravoV on March 17, 2013, 08:31:34 amI would not expect a 10 % overshoot for about 1mS. Is this a power on waveform?Was there a load?The thing that concerns me the most is it looks like you have an oscillation on n019 (the thick trace). Definitely do not want that. It didn't happen with my simulations.What was the load?Richard

author: BravoV
author_rank: Super Contributor
timestamp: March 17, 2013, 12:55:47 pm
content: The load was 1K ohm resistor and yes, the n019 node was oscillating badly.Attached below the ltspice file that I used for that results.

author: amspire
author_rank: Super Contributor
timestamp: March 17, 2013, 02:42:21 pm
content: Ah good. It isn't oscillating. That spice model has 200KHz sinewave applied to the input DC - probably to test rejection of noise from a switching pre-regulator. That "oscillation" was the regulator counteracting the input noise. Turn the Source from sinewave with a 12v DC offset to a 12V dc source - or just make the sinewave amplitude 0. Not sure what the overshoot is about, but it is late here. I will look at that tomorrow.

author: BravoV
author_rank: Super Contributor
timestamp: March 17, 2013, 02:58:59 pm
content: Silly me, my mistake and forgot it totally that I put that noise at the voltage source to simulate switching regulator noise.

author: amspire
author_rank: Super Contributor
timestamp: March 18, 2013, 12:36:06 am
content: Quote from: BravoV on March 17, 2013, 02:58:59 pmYou are just trying to scare me!Here is a modified zero-overshoot circuit. The changes are 10k resistor/cap on the reference input of the regulator, and a diode from the regulator input of the opamp to the output. The overshoot was caused by the limited slew rate of the LM324, so I just had to slow down the rate of change of the reference input to match.There is now zero offshoot.Richard.

author: BravoV
author_rank: Super Contributor
timestamp: March 18, 2013, 01:15:41 am
content: Quote from: amspire on March 18, 2013, 12:36:06 amLol ... busted, maybe I'm not that innocent !Its been a while and I remembered I was thinking that this Mark 3 circuit can be used as well for people that want to tinker with their unused pc psu, cause currently its the most easiest to get and with hefty power capable, hence 12 volt with 200Khz ripple. Although I haven't thought of applying switching residues with those high frequency spikes.Thanks for the update, brief testing on the simulation at the regulation and looks very well.Mind explain a bit whats that new D6 used for ? Will it affect load transient response ?Ok, back to LTspice trying to simulate various load schemes, big capacitance & dynamic load should not be problem right ?

author: amspire
author_rank: Super Contributor
timestamp: March 18, 2013, 01:42:50 am
content: Quote from: BravoV on March 18, 2013, 01:15:41 amThe R/C combination on its own cures the overshoot caused by reference voltage changes, but you can still get overshoot when you put a short on the supply output and then remove it.Just to explain - here is the source of the overshoot. If at a point of time the output is below the reference voltage, the opamp output is fully high and the regulator transistor will be at the current regulation limit. When the output reaches the correct voltage, the opamp output starts to reduce back to normal, but it takes some time to slew back to normal. During this time, the regulator transistor is still pumping out 1A (or whatever the current limit is) and so there will be overshoot - the less capacitance on the output, the more the overshoot. You do not want to add more capacitance in the supply as the charge in any output capacitance gets dumped into the load under fault conditions without any current limiting.You cannot remove the two 10uF caps on the output - they are part of the compensation loop and the caps do most of the output regulation for high frequency transients (100kHz and above). Two low ESR ceramic caps would be better then electrolytics.So to solve the overshoot issue, the trick is to organize things so that when the supply output is lower then the intended reference voltage, make sure the reference is slewing upwards to the intended value at a slower rate then the regulator tracking capability. As long as this is the case, there will be absolutely zero overshoot.D6 drags the regulator reference input pin down when the output is shorted, so the RC time constant works equally well to prevent overshoot for recovery from a shorted output. It also means both of the regulator opamp inputs have 10K resistors which minimizes offset voltage due to input current offset. When the supply is in voltage regulation, there is zero volts across D6 so it does nothing.By the way, for some reason, you had the current reference at 5.5V which means 5.5A limit - the supply is designed for 1A only. From memory, R9 should be 1k but I have to admit, I haven't checked the numbers.I think I originally designed for C1 to be 100p. 470p is probably very stable, but the closer to 100p, the faster the regulator response will be. Finding the best value for C1 in this range is probably something to work out on the bench once a board is built.Richard.

author: BravoV
author_rank: Super Contributor
timestamp: March 18, 2013, 04:10:16 am
content: Richard, from your last ltspice file, the CC mode doesn't work properly and its stuck at 500 ma.What I did was change the load (R24) to 1 ohm, and set the current reference IRef to 10mV for getting 10mA in cc mode.

author: GK
author_rank: Super Contributor
timestamp: March 18, 2013, 05:09:27 am
content: Quote from: amspire on March 15, 2013, 12:33:24 pmMuch better to just use Middlebrooks loop gain probe. BTW, I thought you didn't approve of conditional stability?

author: amspire
author_rank: Super Contributor
timestamp: March 18, 2013, 05:58:47 am
content: Quote from: BravoV on March 18, 2013, 04:10:16 amIt is all coming back to me now. The 1N4148 does not drag the voltage down enough to turn off Q9 fully. A simple fix is to add a diode (like a 1N4004 or a 2N222 with base-collector shorted in a forward direction in series with the Q9 emitter resistor. However doing this increases the needed base drive voltage needed for Q9 at full current and at low supply voltages, the regulator opamp can get a bit close to being marginal.Replacing the 1N4148 with a Schottky (like another MUR745) also works without adding 0.7V to the Q9 base drive, but it is still a bit marginal. I had other ideas but I want to stick to as simple and cheap as possible so I might have to think about this.For now, if the LM324 always has a supply over 4V, put a diode in series with the Q9 emitter resistor. I actually had this originally. If you want to be able to operate with the LM324 supply down to 3v or 4V, change D2 into a MUR745 or any other low drop Schottky. It will probably work completely reliably.I think offset error voltages are in the lm324 models so don't expect great performance down in the low mA range. Put a ramp on the current control, and see for yourself how it behaves. I was always going to include a calibration to help counter offset voltages.Richard.

author: amspire
author_rank: Super Contributor
timestamp: March 18, 2013, 06:31:48 am
content: Quote from: GK on March 18, 2013, 05:09:27 amDefinitey don't want any conditional stability. That's why I have the gigantic 6 degrees phase margin !!!!!Seriously though, the margin is always going to be tight and so I adjusted the margins for a LM324 opamp - not a perfect infinite-bandwidth voltage-controlled voltage source. The curves you get with a LM324 are a bit different.But with any load capacitor causing a near 90 degree phase shift and the opamp causing a phase shift near 90 degrees, simple maths will suggest it is hard to have a big phase margin at all frequencies. I did my best while keeping the circuit simple.Also when I talk of conditional stability, I am including a kind of stability that these curves often hide - instability when the circuit is driven by transients into a non-linear mode (like the opamp saturating for part of an oscillation cycle). When an opamp starts saturating or slew rate limiting, its effective gain and speed parameters change from the small signal parameters.GK, any chance you could do a post on doing a Middlebrooks gain probe in LTSpice? That would be an interesting thread.

author: GK
author_rank: Super Contributor
timestamp: March 18, 2013, 11:14:47 am
content: Quote from: amspire on March 18, 2013, 06:31:48 amThere is not much to it. Open "LTC/LTspiceIV/examples/Educational/LoopGain2.ascEither duplicate or cut/copy and paste the probe elements shown in isolation (attached "Figure1") into your own schematic. The probe is neither impedance nor polarity sensitive - you can stick it anywhere into the loop, either way round. Note that if you cut and paste the probe elements LTspice will automatically rename Vi and Ii Vi1 and Ii1 respectively. You will need to rename them Vi and Ii.Then add this spice directive to your schematic:.step param prb list -1 1You will also need an "AC analysis" directive; for example:.ac dec 100 1 10MegThen run the simulation and click on any node of the circuit just to get something up onto the chart. Right click on the expression for the curve then plotted, then displayed at the top of the chart and paste in the following algebraic expression:-1/(1-1/(2*(I(Vi)@1*V(x)@2-V(x)@1*I(Vi)@2)+V(x)@1+I(Vi)@2))That's it!

author: amspire
author_rank: Super Contributor
timestamp: March 18, 2013, 12:53:00 pm
content: Thanks GK, that worked - once I realized I had to label a node "x".The results don't look too different from my estimates from the design. I am pretty happy with the results. I might post some curves in a few days, if I get the time.Richard.

author: Thor-Arne
author_rank: Unknown
timestamp: March 18, 2013, 12:55:39 pm
content: Ivan: Your circuit is rather slow in stabilizing compared to the original design, any idea why?Edit: Never mind, my mistake.I have another problem simulating this, no output voltage...

author: ivan747
author_rank: Super Contributor
timestamp: March 19, 2013, 01:30:40 am
content: Do you have the right model for the LM324?I everything actually wired up? Some CAD programs I have used have this quirk when you move components around. The line seems to stick to the IC in the schematic but they are not electrically connected.Do you have the right transistor models?Check for everything that goes in series with the main pass transistor.If all of this fails, something must be wrong with my schematic or your schematic. I imitated Amspire's schematic very closely as I just wanted to practice board layout following someone else's specifications.

author: amspire
author_rank: Super Contributor
timestamp: March 19, 2013, 01:46:47 am
content: I tried the loop gain methods in the LTSpice examples that GK mentioned, but I could not get accurate results. For some reason low frequency gain was way out, the the phase shifts were out too. I don't feel like spending time working out what is wrong with the closed loop methods of measuring the open loop gain and phase.I resorted to a very simple method:1. Do a transient analysis and record the output volts exactly.2. Disconnect the opamp 10K sense resistor and attach it to a voltage source.3. Set the voltage source to "AC 1" with a DC offset exactly equal to the output voltage from the transient analysis.4. Do the AC analysis and view the output to get the genuine open loop response.Here is the result with C1=220p, 10V output no load:Pretty happy. 45 degrees phase margin.Sorry the traces are a bit hard to see. Fairly smooth gain roll-off which is good. The ideal was to get as close as possible to the 6db/octave rolloff down to 0dB gain.

author: amspire
author_rank: Super Contributor
timestamp: March 19, 2013, 01:55:50 am
content: Ivan747, I will be posting some improvements to the power supply design in the next few days.One is the changes I did for Bravo recently in the LTSpice file I posted. Just thought you would like to know.I am thinking it is about time I built a prototype myself, so I am sorting out a few issues first.Richard.

author: GK
author_rank: Super Contributor
timestamp: March 19, 2013, 02:13:00 am
content: Quote from: amspire on March 19, 2013, 01:46:47 amI think you are misinterpreting the results. Properly applied, that loop gain probe can certainly be trusted.Unless the circuit diagram has changed significantly, your plot above doesn’t look right to me. For example, you have a very low frequency pole (sub 10Hz if the op-amp open loop gain is >80dB) provided by the error amplifier (an integrator) as well another pole at 8Hz formed by the 20uF output capacitance and the effective 1k open loop collector impedance of the pass transistors (R21 dominates). However you plot doesn’t show the start of a 2-pole roll-off until >1kHz?? It should begin rolling off at -40dB/decade at >8Hz.

author: amspire
author_rank: Super Contributor
timestamp: March 19, 2013, 07:10:16 am
content: GK, you are totally right. The way I had protection diodes connected in relation to the probe was causing some weird results, and now the numbers make much more sense.I was getting a low frequency loopg ain with the probe before flattenning at 55dB and that didn't make sense.Now I am getting 120dB+ which is much more like it. I am not sure why the open loop gain test I did didn't properly show the correct phase shift due to the output capacitors - all I can think is that it did the AC simulation with a incorrect operating point, but I don't know how to check the operating point during the AC sim. If I do a DC operating point simulation, everything seemed biased correctly.I will post some new plots soon.Thanks - Richard.

author: Thor-Arne
author_rank: Unknown
timestamp: March 19, 2013, 07:27:04 am
content: Quote from: ivan747 on March 19, 2013, 01:30:40 amThe model for the OpAmp is the one I got from BravoV, so that one is ok. The other modes is the ones that comes with LTspice.I didn't have the correct models for D5 and D10, I tried with some of the others Schottkys in LTspice. That should be ok? Right?I'll recheck the entire schematic again today.

author: ivan747
author_rank: Super Contributor
timestamp: March 19, 2013, 08:25:34 pm
content: A new multimeter is in its way, and I should be getting some free time by next week. Let's see if I can try some of the designs.

author: Thor-Arne
author_rank: Unknown
timestamp: March 19, 2013, 08:37:47 pm
content: Sounds like a plan.I was planing on breadboarding it to, but that got delayed until next week here to.