First self designed analog circuit. Feedback would be appreciated - Page 1
Forum section: electronics / beginners

author: alxnik
author_rank: Regular Contributor
timestamp: January 02, 2014, 10:55:55 pm
content: And of course it's a linear power supply, what did you expect?I started with a CV/CC power supply design and heavily modified it. My goals were to have 4-5A of output and to use seperate power rails for the opamps, so I can be able to boost the in/out voltage to 40-45VI have the almost final design (as seen in the attached files). I'm somewhat happy with it although I am pretty sure there are things that I'm missing so I any feedback would be appreciated.Some questions:1. After breadboarding the thing, I get noise (not oscillation) of ~50mV. Is this normal, given that I haven't taken any special measures in the measuring procedure and after all it's on a breadboard. What is a noise figure for a relatively good power supply? (Just to have something to reach for)2. What would be a proper way to build it? I will probably build 4 of them for 4 different channels so I'm between veroboard and actually prototyping it on a proper PCB so I can add proper ground planes etc. Is a proper PCB going to add in the overall quality of the output?3. Considering the power rails, would it be better to add pos/neg regulators? Am I going to see any improvement in the output quality?4. These 4 channels are going to have 2 80cm fans (don't know specs, they are salavaged). Not really sure about the heatsink size I will be needing. I already have some salvaged ones from computer power supplies, will they be enough given the general airflow? (FWIW On the todo list is a micro controlled thermal shutdown so I don't care if I am on the low side, just not really low side)5. What transient numbers (in Volts over/under as well as time to stabilise) should I shoot for when connecting/disconnecting a load? I started some measurements but I have no reference at all to compare to so I have no idea if what I have is good or bad6. Eventually Vref will be replaced with filtered PWM from a micro. Although my initial measurements did seem promising (32khz PWM, 10hz lowpass) am I shooting my foot with this?I'm pretty sure I have more questions, but my head is overflowing with electronics right now.BTW, The opamps will be TL082, I just don't have their models in ltspice so I added lm358

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: January 03, 2014, 12:03:40 am
content: Looks like you've picked up some good tips from another threadObvious questions:Why is the op-amp supply separate? I don't see why it can't be derived from the main supply, meaning that a single transformer winding could be used. Yes, you'd need to drop down from the main unregulated rail, but that should be dead easy - given the high input voltage you suggest I'd consider a current source (1 or 2 transistors) driving a zener... I'm guessing that the positive op-amp supply only needs to be 5 volts or soIt appears that feedback for the negative output terminal is taken before the shunt resistance. As you're aiming for quite high output currents, I'd change that. Note that if you do, then the current taken by U1 and all associated circuitry might add an offset, preventing you from selecting minimum current without introducing a complementary offset somewhere else. The connection between GndPower and GndRail should be better and more explicitly shown, and I would expect the connection to take place on the left hand side of the shunt resistor.What is C9 meant to be doing? It almost certainly ought to be around U5.Why do you need U7? Hint: you don't.Why TL08x? They are a PITA for DC applications - they do very strange things at times (phase inversion when the common-mode signal reaches a certain level). I don't see a problem with the Spice-suggested LM358 in all honesty. Even the humble 741 will be fine.For noise, expect less than a millivolt in a correctly implemented circuit. Yes, a millivolt. And that should be random noise - no sign of 100/120Hz or any other distinct frequencies. To achieve this, you'll need to spend a lot of time understanding the circuit, "seeing" where the currents flow - especially the 0V currents. Don't waste your time with a ground plane - there is no point. What is "ground" anyway? Understand that PCB traces have non-zero resistance, ask yourself where the currents flow, and therefore what voltages develop and how do they add themselves to the output. BTW, when drawing power supplies like this, I draw complete diagrams showing all interconnections, rather than relying on the labelled rails - it just makes all this stuff more explicit and it's then easier to understand where the currents are actually flowing.How to build them? I'd thoroughly debug on breadboard and prototype on Veroboard. Whether I went to a PCB depends on how many I plan to make. PCBs are quite expensive. Then again, Veroboard projects always look a bit rough. There's no reason for that, BTW - apart from a lack of planning. I'm quite happy with how my Veroboard stuff turns out. Done properly, there is will be no performance advantage with a PCB (also done properly). Doing either properly is easier said than done - I refer you to the previous paragraph :-)Why is R7 as high as that? I'd expect to see perhaps a tenth of that value there. And you might need to add compensation around it, as it has open-loop gain. When testing for transient response, look for <20ms to get to within 50mV of the output - some specifications and discussion here:http://www.mhennessy.f9.co.uk/dualpsu/dualpsu3.htmRegarding question 3, are you asking about regulating the supplies to the op-amps? Might not make much difference, but it depends on how much ripple is present on the reference - have a look with your 'scope.Replacing the reference with a PWM might work, but be sure to filter well. And bear in mind that now the unit is only as accurate as the 5V (or whatever) supply that feeds the micro, so you might get drift. Personally, I don't see the point of programmable power supplies for general bench use. I've often thought about trying to build one - yes, I can program - but always talk myself out of it...Of course, if you have 4 in the same box, driven by the same micro, you'll need opto-isolation so that all four continue to be floating sources. Then, the transistor in the opto-isolator could be employed to short out the reference. Or - less risky - it could control a CMOS analogue switch - even a "jellybean" 4066 might be good, properly implemented.Regarding heatsinking, the general rule is that you can never have enough. I doubt that scrap ATX power supply heatsinks will be anything like good enough - you need something that is literally massive for the voltages and currents you are after (and I've given no thought whatsoever to your proposed MOS-FET in that regard, BTW). For the fan speed controller, you are proposing the most complex and least reliable solution possible. I would use an NTC and a couple of transistors. Been there, done that. For the over-temp shutdown, I would use a bi-metallic switch that can turn off the mains, or perhaps remove the drive to output relays for the DC outputs.I never understand why beginners pick such complicated goals for their first PSU project. I wonder if it's because everyone assumes that PSU design is easy (which is why there are so many bad PSUs out there!). Start simple, see what the issues are, solve them one by one. That's why starting with an LM317 is a good plan - it won't get you a lab-grade PSU, but it'll be usable and will teach you the basics at minimum cost. Just the transformer for this one will cost an absolute fortune, let alone the heatsinks. </rant>Looking forward to seeing the progress on this,Mark

author: alxnik
author_rank: Regular Contributor
timestamp: January 03, 2014, 12:55:08 am
content: Mark, thanks for the reply. Below are the reasons behind my design choices. Not sure if they are actually correct, considering my experience they seem reasonableQuoteThe reason for the strange supply configuration is that I already have 2 salvaged 100VA transformers with many secondaries which also have seperate 18VAC windings. Given that, it's actually easier to just put a bridge and a cap.QuoteU7 is there just to amplify the signal. Without amplification the offset voltage of the opamp becomes significant. Also the reference input is 0-5V and I didn't want to divide it.QuoteYou most probably have a point, I have to check thisQuoteR7 is high or else it drives the transistor into saturation quite fast and the mosfet driving is almost square waveQuoteDamn right, thanks on thisQuoteVery very good pointQuote10 turn pots are expensive...QuoteI don't care about the result! I'm working this project for months. I've fried 10s of opamps, transistors, mosfets, had some loud cap blowouts, built many vero's which I scrapped etc etc etc. I don't really care when this is finished or if it is ever finished, I just like working on it.

author: babysitter
author_rank: Frequent Contributor
timestamp: January 03, 2014, 12:25:19 pm
content: Please take care that you never ever accept positive feedback in this circuit

author: sync
author_rank: Frequent Contributor
timestamp: January 03, 2014, 01:03:05 pm
content: The IRL520 is way to small. With 40V DC input and 5A at 0V output it has to dissipate 200W. According to the data sheet it has an absolute maximum rating of 60W at 25°C transistor case temperature. Which is unrealistic because you have to cool the heat sink under 25°C. You will need many parallel transistors and likely more powerful ones.

author: alxnik
author_rank: Regular Contributor
timestamp: January 03, 2014, 01:22:33 pm
content: Quote from: babysitter on January 03, 2014, 12:25:19 pmCome to think of it, If I wanted positive feedback, I would show it to my motherQuote from: sync on January 03, 2014, 01:03:05 pmIndeed, I just had this in my drawers and started experimenting with it - my tests until now were up to 1-1.5A for short periods of time. However after finalising the analog part I will add a micro controlled relay board that switches between taps of the transformers so I am expecting a max voltage drop of ~8-9V on the mosfet. I am experimenting with the idea of a switched mode pre-regulator, although it's too much for now

author: Rerouter
author_rank: Super Contributor
timestamp: January 03, 2014, 01:36:06 pm
content: As your using AC, and you have a micro handy, you could use a MOC3041 opto-triac to be your switch mode supply, switching on the output of the transformer only for a limited amount of the waveform and limiting the average voltage into your rectifier bridge (it would be as simple as a comparator measuring your arduino filtered pwm and a divided down point on the mains to rise above)in this case you use that device to drive a larger triac,

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: January 03, 2014, 02:47:38 pm
content: Quote from: alxnik on January 03, 2014, 12:55:08 amOK, if that's what you have, then it makes sense. Personally, I'd want to know the current capability of all the windings, because I'd be worried about "wasting" the potential in each - indeed, in the past, I've added extra small transformers to deal with the control and metering side, leaving me free to fully exploit each of the windings on the large transformer. Just a thought - obviously, it's a judgement call ultimately...QuoteYes, I am familiar with the concept of an op-amp used as and amplifierI have built countless power supplies with current limiting, and have never amplified the voltage across the shunt. Actually, that's not entirely true; I did it once and decided to never do it again as it introduced more problems than it solved.I arrange for about half a volt to be dropped across the shunt. This is arbitrary - it could be more, it could be less. Then I set up the current potentiometer to provide this range of voltage to the other input of the op-amp. Obviously, this needs to be done in a way that isn't influenced by the poor (typically 10%) tolerance of the potentiometer itself - although a "set max I" preset is useful here. Of course, for a super-basic design, a standard 1N4148 is a good enough reference.BTW, there is nothing wrong with dividing down a reference voltage - that's what the front panel controls are doing! You can buy resistors with very good tempco if required, although I'd suggest that the tempco of the current side is much less critical than the voltage regulator.I have never run into problems with offset voltages. I've seen this mentioned in other threads, but I can't help feeling that it is merely speculation - the trouble with the internet today is that it's easier to talk about things than actually try them! I only use "jellybean" op-amps for this sort of thing - 741s or LM1458 or similar. In fact, the only time I did run into this was during my ill-fated experiments with amplification mentioned above - I ended up having to null for CMRR and offset, and it was a PITA. Went to low-side sensing - which forced me to think correctly about the earth paths - and have never looked back (or trimmed!). Just remember to match resistances seen by each op-amp input. BTW, the supply in question is the one I linked to earlier.Of course, the shunt must be included in the voltage feedback loop, which it isn't at the moment. That means that all of the voltage-related circuitry (reference, ect) must be connected to the output side of the shunt with your chosen topology. This can be done - without introducing offset currents in the shunt - by using a separate winding for the control circuitry (this is of course why I asked about that issue initially).Oh - while I think of it: have you see the Thurlby-Thandar units that show you the current limit on the current meter when the DC output switch is off? Personally, I regard that as an essential feature, and all my supplies do that. All you need is a simple SPDT switch that picks off the feed for the current meter from either the shunt, or the feed from the current potentiometer. Simple!QuoteYes, but that's the wrong way to reduce the gain. Apart from anything else, have you ever heard of "thermal noise"?Use a resistor in the emitter of the transistor.This resistor serves a secondary purpose: should something "bad" happen in the collector circuit, the resistor will limit the maximum current that can flow through the transistor, and that means that the trail of "consequential damage" stops there. Classic old-school design - we can learn a lot from our forefathers in this gameAlso, when optimising transient response, you can place R-C networks in parallel with the emitter resistor if required.QuoteYes, they are. And over-rated IMHO.I know it's a personal thing, and I know that some people have strong feeling about them, but having used both options over the years, I much prefer Course and Fine adjustments. I found that 10-turn pots had resolution problems, as you still have a wiper making contact with a wire-wound track. I have good stocks of them here - I never throw anything away, and I will dive into any skip I see - but I rarely use them.One feature that is nice about programmable supplies - the ability to alter two (or more) outputs simultaneously. With a conventional supply, this is only possible if they units are tracking - which means that they will be joined together electrically (split supply). Sometimes, this isn't what you want. Oh, and setting a span range, which avoids "accidents". Beyond that, I'm struggling for bench use. In ATE environments, it's a no-brainer, of course.Anyway, hope this helps in some way. It's an ambitious project, but it's worth the effort - especially as you seem to place a higher priority on learning rather than the final outcome, which I think is definitely the best approachAll the best,MarkPS: Have you ever looked at the "floating" topology that is used my most commercial supplies? Fascinating, subtle, but very reliable and very scalable. It's what I generally use these days, as it's not limited by the working range of op-amps (nor is yours, of course), but doesn't require a gain stage between control and pass device(s). One day I'll write an article on the topology. One day...

author: alxnik
author_rank: Regular Contributor
timestamp: January 03, 2014, 05:15:40 pm
content: Mark,I can say that with your feedback I already have a more stable iteration, thanks for that.Quote from: Mark Hennessy on January 03, 2014, 02:47:38 pmI removed it, and the design is much more stable, you are correct.QuoteI tried many iterations of the driving transistors circuit, and I settled on the one with a high resistor because with an emitter resistor the mosfet could not be driven to 0V, so I'm not sure how to build it. Care to share an example?You have given me much info to work with (probably more than I can absord right now) but I think I still can make many improvements which is what I was shooting for

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: January 04, 2014, 12:17:50 am
content: Quote from: alxnik on January 03, 2014, 05:15:40 pmThat's great - I'm glad to helpQuoteYes, you would need to return the emitter resistor to the -5.1V rail.As I implied, the objective is to reduce circuit impedance because thermal noise is a real problem (well, my normal work is in audio, where it really is bad news). And high impedance nodes are prone to picking up interference. As a rough rule of thumb, I'd be looking to have no more than 5 or 10k between op-amp and transistor base.Actually, this amplifier could be a little bit tricky. I don't know how much transistor theory you know, so forgive me if I'm stating the obvious here...The gain of a common-emitter amplifier with a grounded emitter is gm.RL, where gm is 35Ic (or 40Ic, depending on what you assume for T). What determines Ic? The voltage on the collector. So, as you lift up the output voltage, there is less voltage across R14, hence less collector current and less voltage gain.This varying open-loop gain could cause problems when trying to optimise the transient response, so best to tame it now. Negative feedback around the transistor will do that, and of course, an emitter resistor is the conventional way to do that. As you've found, the voltage drop across this resistor will cause problems. If this resistor is returned to the -5.1V rail, what value could it be? Well, assuming the unregulated input might be 50V, and ignoring the MOS-FET Vgs voltage for simplicity, the highest current in R14 will be 22.7mA (BTW, this component will run warm, dissipating over a watt under this condition). Assuming that we want no more than around 4 volts across the emitter resistor, that sets an upper limit of 180 ohms. This gives a closed-loop gain of around 12, and greatly reduces the gain variations with output voltage.Having said all that, the emitter current might cause problems with the current control by injecting currents into the shunt - that's because I think the ground for the control circuits and reference need to go on the output side of the shunt.So perhaps it would be best to use a feedback resistor between collector and base (emitter returned to GndPower). In which case, try 4k7 between diodes and base, and 47k between collector and base - this should give a gain of 10 (slightly less in practice because of the relatively low open-loop gain that a transistor has). I suspect that the lower the closed-loop gain, the better.With this arrangement, the base current will cause an error current to be injected into the shunt, but it will be much less than the first plan...Hope this "thinking out load" makes sense, and gives you some more ideas to experiment with - have funMark