Analog challenge exercise - Page 1
Forum section: electronics / projects

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 05, 2020, 11:12:51 pm
content: Today's challenge:* Switching supply, single isolated output* Low power, say 5-12V at a few mA* Modest efficiency at nominal output (>50%?)* Wide input range, say 5-30V* Well behaved under source/load extremes (e.g., should probably have current limiting, or current mode control or the like)* Discrete analog preferred, i.e. resistors, capacitors, inductors, diodes, transistors* Least parts and cost winsMy example:https://www.seventransistorlabs.com/Images/Discrete_Flyback.pdfA six-transistor (I know, I'm one short, how could I do this?), 30 part design. All discrete, implements peak current mode switching, in PFM (pulse frequency modulation). Rather than controlling for regulation, a fixed operating point is used, with zener shunt regulation at the output. (This is fair, as only efficiency at nominal load is stipulated.) Transformer is a data line type common mode choke -- these have quite reasonable leakage (L1, L2 and k should be about as shown, assuming I didn't make an error), and a low voltage rating (50-100V). A higher rating would of course be convenient, but nothing is available in a small size (however, the cost doesn't need to be much more; Taiyo Yuden TLF9 family for example seems to be great bang for the buck?).Q2B and associated components are pretty much optional, but as I used transistor pairs in this design, it was handy. (We can debate the merits of semantic versus physical component count, and also how to weight that in terms of costs.)Don't have an LTSpice version, but here's the netlist more or less if you want to get started with this version:Code:C1 TIMER 0 470pF IC=0C2 REF SW2 1pF IC=0C3 OUT GNDO 1uF IC=9C4 BST2 BST1 220pF IC=15C5 REF 0 10pF IC=0C6 VCC SN 220pF IC=0C7 VCC 0 1uF IC=0D1 REF SW2 1N4148XD2 SW3 OUT BAT85D3 B1 B2 1N4148XD4 B2 BST1 BAT85XD5 GNDO OUT ZENER PARAMS: VALUE=9VQ1A VCC TIMER TIMEB BC847Q1B TIMER TIMEB TIMEE BC847Q2A B1 REF TIMEE QBC857Q2B SH2 BST2 BST3 QBC857Q3A SW1 B2 SH1 BC847Q3B BST1 SH2 0 BC847R1 VCC TIMER 47kR2 VCC REF 47kR3 TIMEB TIMEE 100R4 SW2 SW1 10kR5 B1 BST3 100R6 B1 BST2 10kR7 OUT GNDO 10kR8 REF 0 100kR9 SN SW1 4.7kR10 SH2 SH1 1kR11 B2 0 1kR12 SH1 0 4.7RS1 0 GNDO 1mLA_KT1 SW1 VCC 100uHLB_KT1 SW3 GNDO 100uHKT1 LA_KT1 LB_KT1 0.9992V1 VCC 0 24.MODEL 1N4148 D IS = 4.352E-9 N = 1.906 BV = 100 IBV = 0.001 RS = 0.6458 CJO =+ 7.048E-13 VJ = 0.869 M = 0.03 FC = 0.5 TT = 3.48E-9.SUBCKT BAT85 1 2D1 1 2 BAT85R1 1 2 5.416E+7.MODEL BAT85 D IS = 2.076E-7 N = 1.023 BV = 33 IBV = 10E-6 RS = 2.326 CJO =+ 1.21E-11 VJ = 0.1319 M = 0.2904 EG = 0.69 XTI = 2.ENDS BAT85.SUBCKT ZENER 1 2 PARAMS: Value=5.1VDDF 1 2 DFRREV 1 2 2e6.MODEL DF D ( IS=28.3p RS=5 N=1.10 BV={Value} IBV=1m CJO=66.2p VJ=0.750 M=0.330+ TT=50.1n ).ENDS.MODEL BC847 NPN IS = 1.822E-14 NF = 0.9932 ISE = 2.894E-16 NE = 1.4 BF = 324.4+ IKF = 0.109 VAF = 82 NR = 0.9931 ISC = 9.982E-12 NC = 1.763 BR = 8.29 IKR = 0.09+ VAR = 17.9 RB = 10 IRB = 5E-06 RBM = 5 RE = 0.649 RC = 0.7014 XTB = 0 EG = 1.11+ XTI = 3 CJE = 1.244E-11 VJE = 0.7579 MJE = 0.3656 TF = 4.908E-10 XTF = 9.51 VTF+ = 2.927 ITF = 0.3131 PTF = 0 CJC = 3.347E-12 VJC = 0.5463 MJC = 0.391 XCJC =+ 0.6193 TR = 9E-08 CJS = 0 VJS = 0.75 MJS = 0.333 FC = 0.979.MODEL QBC857 PNP IS = 2.014E-14 NF = 0.9974 ISE = 6.578E-15 NE = 1.45 BF = 315.3+ IKF = 0.079 VAF = 39.15 NR = 0.9952 ISC = 1.633E-14 NC = 1.15 BR = 8.68 IKR =+ 0.09 VAR = 9.5 RB = 10 IRB = 5E-06 RBM = 5E-06 RE = 0.663 RC = 0.718 XTB = 0 EG+ = 1.11 XTI = 3 CJE = 1.135E-11 VJE = 0.7071 MJE = 0.3808 TF = 6.546E-10 XTF =+ 5.387 VTF = 6.245 ITF = 0.2108 PTF = 0 CJC = 6.395E-12 VJC = 0.4951 MJC = 0.44+ XCJC = 0.6288 TR = 5.5E-08 CJS = 0 VJS = 0.75 MJS = 0.333 FC = 0.9059.SAVE 0 B1 B2 BST1 BST2 BST3 GNDO OUT REF SH1 SH2 SN SW1 SW2 SW3 TIMEB TIMEE.SAVE TIMER VCC.OPTIONS ABSTOL=1E-9 CHGTOL=1E-9 GMIN=1E-9 ITL4=400 RELTOL=0.0001 RSHUNT=1E9.OPTIONS TRTOL=3 VNTOL=0.0001 METHOD=GEAR MAXORD=2.TRAN 1E-7 0.001 0 5E-6 UIC.ENDTim

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 06, 2020, 03:01:21 am
content: Your challenge is beyond my skill level! I'll have to study your circuit and see how the pros do it.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 06, 2020, 12:14:02 pm
content: Synthesis of these sorts of circuits is quite a puzzle, yes.The general plan of this one is an oscillator, of course, more specifically a multivibrator.Q1A and Q2A, along with R1, C1 and R2, R8, makes a complementary "differential pair". This is an interesting motif because, though it makes a terrible diff pair (there's a 2*Vbe offset!), the "tail" current -- rather than being sourced from somewhere, then steered between the pair -- is itself what's being sourced. So this can turn on very aggressively, without requiring almost any quiescent current.You can also think of it as a common emitter amplifier with a fixed offset, which is apparent in this application:https://www.seventransistorlabs.com/Images/LED_Light2.pngthe top-left NPN could be replaced by a (rather beefy) resistor divider, serving as threshold voltage for its companion. In this case, the resistor divider can be hFE times larger, saving on bias current!Anyway, Q2A connector drives Q3A base, turning on the main switch. To hold it on, D1, R4 applies positive feedback. (Note another feature of the "complementary diff pair", the bases conduct forward, so C1 gets discharged through D1 and Q3A base.) Q3A remains on (via R1 and R4 into Q1A, Q2A), with base current set by Q1B (a Vbe current limiter -- note that it shunts the capacitor directly, so capacitor discharge current actually flows through Q1B).Eventually, SH1 voltage rises to a Vbe, turning on Q3B and turning off Q3A. When Q3A collector voltage begins to rise, positive feedback snaps everything off (with a little help from C2) and the circuit resets to its initial timing state (C1 charging through R1).Note that C1 ends up discharged (down to a few volts) during the on-pulse, which implements holdoff compared to a free-running oscillator like you'd have in a typical peak-current-mode controller like UC3842.I don't think Q2B is actually doing anything right now, I mean with components and values as shown; but it's supposed to provide another little burst of positive feedback, with D3 increasing the B1 "on" voltage, and C4 triggering Q2B triggering Q3B to turn off Q3A more rapidly.That's a long story for two halves of a waveform, but so what? I called it a multivibrator, because it is -- there are two important time constants, R1*C1 and T1 and R17 (sort of). This works fundamentally the same as a two-transistor multivibrator, which uses two RC time constants. This kind of flips it, and uses some other fancy blocks (like the complementary "diff" pair, and the peak current mode switch), to use an RC and RL time constant instead. The L of course being necessary for the intended function.Tim

author: nctnico
author_rank: Super Contributor
timestamp: February 06, 2020, 01:48:11 pm
content: I have build something like this before using an NE555 and an external transistor. Current limited too IIRC.

author: tszaboo
author_rank: Super Contributor
timestamp: February 06, 2020, 02:04:14 pm
content: I have an entry for the "least part":WE 1779106321526.7KOhm resistor, 0603

author: schmitt trigger
author_rank: Super Contributor
timestamp: February 06, 2020, 02:28:30 pm
content: Tim;although I can generally analyze discrete transistor circuits which are operating linearly, these discrete current steering and blocking oscillators have been always a struggle. Even back then when I had much more practice.I literally "take my hat off" towards the engineer who can still design these types of circuits.Congratulations, my friend. You are one sharp cookie.I remember many moons ago, viewing in awe an all-discrete-transistor TV sync generator schematic, made by RCA. All sorts of steering and blocking signals, discrete dividers and level shifters.I thought to myself: How does this thing start up? Or worse, if one of these transistors becomes leaky, how in the heck can one troubleshoot it?

author: Wimberleytech
author_rank: Super Contributor
timestamp: February 06, 2020, 03:11:37 pm
content: Doing my good dead for the day (a good turn daily?).Drew this up in LTSpice for people to play with.Create your own .model file using the models 7tran provided.I used a stock zener.

author: Wimberleytech
author_rank: Super Contributor
timestamp: February 06, 2020, 03:31:53 pm
content: And here is a 1-transistor version.I have no clue about the efficiency.

author: Kleinstein
author_rank: Super Contributor
timestamp: February 06, 2020, 04:35:02 pm
content: With the wide input range the simple zener shunt regulation may not be adequate - unless the converter does at least some coarse stabilization.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 06, 2020, 06:18:37 pm
content: Quote from: schmitt trigger on February 06, 2020, 02:28:30 pmYeah, some of these circuits I come back to and ponder whether I ever really understood them the way I thought I did, or how to continue working with it or if it's easier to start over. See also: "write only" code.Another interesting question is, the space of few-component circuits: there are about a hundred, variously useful or understandable configurations of just two transistors (taken out to 2-5 terminals). What about the set of three transistor circuits, or two transistors and one resistor, or diode, or two, or... It's a huge space, but still a very finite space! (One could then ask if any of those circuits have behavior applicable to the present problem.)Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 06, 2020, 06:20:51 pm
content: Quote from: Kleinstein on February 06, 2020, 04:35:02 pmIt does, actually -- the RC timing is fairly frequency-stable (considering), for similar reasons why the 555 is stable; the switch charges the inductor to a fixed peak current, therefore as long as the output is DCM (which can be guaranteed, if a low enough duty cycle is chosen, which is also to say, a low enough nominal output current relative to the peak switch current), so the zener really doesn't have to do much with respect to line variations, only load variations.Tim

author: Marco
author_rank: Super Contributor
timestamp: February 06, 2020, 06:46:19 pm
content: How much common mode current are those cores able to take before saturating?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 06, 2020, 09:29:16 pm
content: Asking the real questions!I measured a Pulse brand, 1812 footprint (I don't have the exact part number on me at the moment..), 51uH part with saturation over 200mA. A pleasant surprise!Tim

author: Marco
author_rank: Super Contributor
timestamp: February 07, 2020, 12:59:36 am
content: A constant power design is likely unbeatable on component count.If you weigh efficiency a little heavier you could probably find some interesting circuits though. Usually the initial primary voltage spike before the current gets going on the secondary makes primary side regulation difficult with flybacks ... but what if you put a two transistor+zener overvoltage protection circuit on the secondary? When that blocks the current you'll get much larger primary voltage spikes, should be some way to use that for regulation with more consistent efficiency across loads.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 07, 2020, 01:36:58 am
content: Y'mean an SCR to shunt the secondary when it's at nominal voltage? Has problems with reset flux and primary timing of course, but could be done.Or a... the opposite of an SCR, it's on by default then snaps off at the threshold? That would certainly be a cool way to reduce isolation component count -- even in regular circuits, where you just want to save an opto or whatever! Not sure how you'd do that, maybe bias resistors to keep a transistor on then something like a foldback current limiter but sharper so it snaps off.The newest and cheapest offline regulators do this sort of stuff; primary side regulation, not with secondary side shenanigans, of course; impressive simplicity, low parts count, low pin count even, mediocre efficiency but who cares when you're doing a stupid 5V 1W charger or whatever.For those curious about something even simpler, here's a classic:http://www.romanblack.com/smps/smps.htmDownsides are high output ripple, no protection, narrow input range, etc. You can't expect much from just two transistors, after all; it's only barely enough to even oscillate!We can of course oscillate with one, if we allow transformers; my response to that would be: alright, where are you buying that transformer, off the shelf, for as cheap?Heh... which, there's another thought: so what about transformers, we don't need steenkin' components, do a planar winding in the PCB! And yes you can put core around it, but planar cores aren't terribly cheap in modest quantity either, nor are ferrite plates, etc. But, y'know, you don't even need them if it's high enough frequency. Now, you'd be right to guess RF transistors aren't going to be affordable outside of mass production quantities... but there's power GaN. The EPC2036 is $0.47 in 100s from Digi-Key. That's not terrible, and would make for one hell of a blocking oscillator.Sheesh... I wonder if you can even pull off a GaN oscillator, without blowing up the gate in a single (or few) cycle(s)... not to mention minding the power dissipation rating of that dinky chip.Tim

author: Marco
author_rank: Super Contributor
timestamp: February 07, 2020, 06:28:36 am
content: Quote from: T3sl4co1l on February 07, 2020, 01:36:58 amYeah, just completely block the secondary. When the secondary stays open, all the energy gets dumped into the snubber (potentially lossless, 2 diodes an inductor and a capacitor). You could probably detect that relatively simply compared to ordinary primary feedback, which requires carefully timed sampling.PS. unshielded coreless PCB transformers probably won't make HAMs happy.

author: george.b
author_rank: Frequent Contributor
timestamp: February 07, 2020, 01:10:14 pm
content: I found this on the interwebs. T3sl4co1l should probably love it.

author: Yansi
author_rank: Super Contributor
timestamp: February 07, 2020, 01:21:57 pm
content: My version of what I did years back. Nothing special about it, you could even rewire it to take feedback from the primary side. This way the output is better regulated.//Take the output currrent rating with a grain of salt. It indeed could put out 100mA or so, but it is not the recommended load level

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 07, 2020, 09:36:35 pm
content: Quote from: george.b on February 07, 2020, 01:10:14 pmThe price and component count are certainly attractive, but the idle current (4mA) blows any hope of efficiency.Incidentally, NCP3063/4 is an improved version, which I don't mind so much (I even designed one in, last year). Same high idle current though.Tim

author: george.b
author_rank: Frequent Contributor
timestamp: February 07, 2020, 11:02:46 pm
content: Quote from: T3sl4co1l on February 07, 2020, 09:36:35 pmThat's interesting and good to know. I've recently cobbled together a 5 to 24V boost circuit (to replace an old and tired CCFL backlight for LEDs) using a 34063 from my junk bin, all the while remembering that Imgur post of yours about itI can hear a bit of whine, though, which the higher operating frequency of this improved version might take care of. Gotta try it sometime.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 08, 2020, 01:01:24 am
content: ...Which, for those who haven't seen it, and also, I update from time to time:https://imgur.com/gallery/M1S0DbITim

author: SilverSolder
author_rank: Super Contributor
timestamp: February 08, 2020, 01:19:45 am
content: I have seen the single transistor circuit in actual made-in-China 5v wall wart supplies... They worked OK up to about 100mA...

author: SilverSolder
author_rank: Super Contributor
timestamp: February 08, 2020, 12:35:06 pm
content: Quote from: blueskull on February 08, 2020, 04:42:29 amI tested it, it couldn't do more than about 100mA before the voltage had dropped below the USB spec. The transistor in the device I tested was something very ordinary, in a TO-92 plastic case...I was impressed that it worked at all, let alone supplied 100mA! To me, an engineer that does a lot with a little, has magic and genius in him.

author: SilverSolder
author_rank: Super Contributor
timestamp: February 08, 2020, 05:19:48 pm
content: Quote from: blueskull on February 08, 2020, 01:45:55 pmMine did not have an optocoupler feedback. I did trace the circuit and I think you are right, it did use a winding on the transformer for feedback. It was built down to the absolute minimum cost with as few parts as possible... which was not many parts at all!

author: Yansi
author_rank: Super Contributor
timestamp: February 08, 2020, 10:03:41 pm
content: Quote from: blueskull on February 08, 2020, 01:45:55 pmNope they aren't. They are halfbridges and not self oscillating. (typically, the good ole mother 494). Maybe just the small metal case ones up to some 20 30W or what. (Never seen one with flyback yet, neither did I have a small one under 100W in my hands).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 08, 2020, 10:17:27 pm
content: I haven't seen a blocking oscillator since the last time I took apart a VCR, I think. (Aside from the ones I've made myself.) They were strangely popular in consumer AV equipment for... who knows why. Just one of those domain-specific memes, I would guess. Also, somewhat more famously(?) the Apple II, wasn't it?Often the standby/aux supply in ATX PSUs was one, also.They've almost kinda made a return, but typically with the help of a little SOT-23-6 controller which does a better job. Of Taiwanese or Chinese origin, the price is almost negligible; I wonder if parts count -- placement cost -- motivates the update?Apparently there's versions for MOSFET and BJT flyback, and self-excited half bridge (a recent EEVblog video showed a resonant LED supply with such a beast). You can't avoid the cost of a separate drive transformer in the latter case, but perhaps that's justified by the performance advantage of the architecture (which apparently was also implementing PFC somehow!).Tim

author: D Straney
author_rank: Frequent Contributor
timestamp: February 09, 2020, 12:08:25 am
content: I love these sorts of challenges.You know what a good source of blocking oscillators is? Lightbulbs. I only know this because I spent a good deal of time at a previous job doing some "competitor analysis" and reverse-engineering a bunch of cheap-ish but reasonably-quality LED bulbs (and CFLs). [This also means these circuits are too instantly familiar...so I've got to come up with something completely different] Whether buck, buck-boost, or isolated flyback, they mostly converged on the same 2-transistor design: a single power transistor driven by a feedback winding (like Yansi's circuit), but with an extra "peak current control" transistor, with its base on a current sense resistor in series with the power transistor's emitter, which pulls down hard on the power transistor's base once the current ramps up high enough to turn this extra transistor on. Much more elegant than the wild variability of the "turn-off by running out of beta" blocking oscillators, or the lossiness of the "turn-off by saturating the power inductor" ones. There were some minor variations, including 3-component primary-side output over-voltage protection / output voltage regulation: a diode from the feedback winding would conduct in the "inductor discharge" phase, and put its scaled version of the output voltage onto a series resistor and zener diode, which led to the base of that "peak current turn-off" transistor. If the reflected output voltage was high enough to reach (turn-off transistor Vbe + zener voltage + feedback winding diode Vf), then it would start turning off the power transistor early.These descriptions are kinda terrible without diagrams honestly. Maybe I'll draw some up later.Interestingly enough, one of the LED bulbs I opened used a classic CFL circuit (self-oscillating half-bridge, with a defined-saturation-point gate drive xfmr, driving an inductor)...but which fed directly into a bridge rectifier and the output cap. Not at all the optimal solution for a consumer product as it had at least 3x the components of one of the single-transistor blocking oscillators. Must've had one engineer, who knew CFL drivers and only CFL drivers, who heard "DC output" and thought "oh, I can just take this normally-AC output from one of my circuits and rectify it".

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 09, 2020, 03:30:53 am
content: No clue, the photos are too poor to tell if it's a 3-terminal switching regulator or what.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 09, 2020, 03:34:24 am
content: Quote from: D Straney on February 09, 2020, 12:08:25 amEven more interestingly enough(?!?), Sony used a more refined version for a long time, especially in Trinitron monitors. Resonant half bridge oscillator with saturable drive transformer. By biasing the transformer, it saturated early, increasing the switching frequency away from resonance, reducing output voltage. Control is simply a TL431 feeding the control winding, which is wound cross to the feedback windings on a 4-leg core.Tim

author: Mazo
author_rank: Regular Contributor
timestamp: February 09, 2020, 12:13:27 pm
content: My 20min go at it.20-something part count,it sucks in certain aspects mainly the DC accuracy of the error amp but a TL431 will put the transistor count way up