<> - Page 1
Forum section: electronics / projects

author: debininja
author_rank: Contributor
timestamp: May 19, 2017, 04:33:50 pm
content: <>

author: Benta
author_rank: Super Contributor
timestamp: May 19, 2017, 06:08:06 pm
content: Several issues:- your MOSFET drive won't work, and is in my opinion overengineered. The output from the TL494 is open-collector and will never turn on the driver transistors. I'd suggest experimenting with driving the MOSFET directly from the TL494 with a pull-up resistor to turn on the FET. Will give you some losses, but it's much simpler.- I don't like your Zener solution for the feedback. Use a TL431 instead for active drive to the optocoupler. Lots of examples available in appnotes.- No need for the snubber over the rectifier if you use a Schottky diodeThose are just first impressions, other issues might be there.

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 19, 2017, 08:05:20 pm
content: You have either intentional error or unintentional errors in your schematic.1) There is an error the 680R should be connected to VCC (open collector). The IC drive is open collector OR emitter follower, look into what this means.2) Drain to Source snubber with a 22K resistor?, I think you mean 22R, looks like a schematic error.3) make the frequency adjustable no mention of the core material used, 100kHz seems very high to start out with, consider using 25KHz and adjust accordingly.

author: Pitrsek
author_rank: Regular Contributor
timestamp: May 20, 2017, 09:27:00 am
content: You are missing frequency compensation at TL431.Please read:https://www.onsemi.com/pub/Collateral/TND381-D.PDFas a starting point.There is a lot info about feedback on Onsemi(search for papers from C.Basso - his books are also top notch) and TI sitesAlso FB divider needs to be before output filterI would loose 494 and would go with something more modern - preferably with current mode control(a little bit easier to stabilize) and quasi resonant operation

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 20, 2017, 10:18:58 am
content: Quote from: Pitrsek on May 20, 2017, 09:27:00 amNo matter what is part is used. the questions asked are basic, throwing new parts wont help educating him/her, as old as the TL494 chip is, it can teach a circuit builders many many basic concepts. I do like the idea of using new chips with internal driver + fet but they all go poof when subjected to excessive ringing and poor layout. tips and tricks picked up from being a veteran using a TL494/SG3525

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 20, 2017, 10:59:45 am
content: Quote from: debininja on May 19, 2017, 10:03:20 pm1) There is already a parasitic diode inside the MOSFET, (which is sufficient for this application) why another external diode? and why loose the RC snubber ? ask yourself these questions ? study the mosfet model and see paths during switching and why a RC snubber is used. If you need help study thishttp://www.ti.com/lit/an/slpa010/slpa010.pdf2) The local buffer drive arrangement you have for this IC is correct (totem pole), its the preferred technique, using it will latch the gate to ground during off period and offer fast turn off and good performance characteristics (just calculate the fet drive current what your have should be enough), you tame the switching behavior for "hard or soft switching" by adjusting the combination of the gate drive with Rg (gate resistor) + Rb (base resistor) you need to learn how this influences ringing and effect timing characteristics and also effects the selection of the RC snubber to get a decent wave shape. event before dumping the current into the the transformer.You need a scope and you need to learn how to read waveforms and interpret them.

author: Benta
author_rank: Super Contributor
timestamp: May 20, 2017, 11:40:36 am
content: QuoteWhat are you talking about? The diode discussed is the output rectifier with (unnecessary) snubber. You are going on about the MOSFET.

author: Benta
author_rank: Super Contributor
timestamp: May 20, 2017, 02:12:13 pm
content: Your gate driver will still not work. You've found a way to turn it on, but turn-off will be extremely slow.I still strongly suggest you drive the MOSFET directly from the TL494: C to VCC, E to gate, 680 ohms (or lower, check with 'scope) from gate to ground.A comment on the TL494 (which I've worked with many times): it's a very good device to learn about switching regulators on, but for a practical design, I'd not go higher than 40...50 kHz.

author: Benta
author_rank: Super Contributor
timestamp: May 20, 2017, 03:29:43 pm
content: Quote from: debininja on May 20, 2017, 02:40:50 pmWell, then magic's in play, or your schematic does not represent the actual circuit. Q2 has practically no base drive (except for 100k), so I wonder how that plays out.

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 20, 2017, 05:15:51 pm
content: Quote from: Benta on May 20, 2017, 03:29:43 pmYou are confusing yourself. of course there is base drive. see attachment.I would recommend using it in open collector mode instead, with a 220R instead of a 680R.

author: MagicSmoker
author_rank: Super Contributor
timestamp: May 20, 2017, 06:29:57 pm
content: Quote from: debininja on May 20, 2017, 02:40:50 pmThe output transistor inside the '494 can only source current the way you have it wired up to your push-pull driver, which will turn on Q1 quite quickly, yes, but turn-off of Q1 and turn on of Q2 will take place very slowly because you are using a 100k resistor to sink charge out of the bases.Attached are the LTSpice simulation results (and the LTSpice file, for those interested) showing how just a minor change in the location and value of the base pulldown resistor dramatically improves switching performance.

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 20, 2017, 06:44:20 pm
content: Quote from: debininja on May 20, 2017, 05:45:19 pmHere is the difference between them. (read the datasheet)As you can see the signals are inverted.

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 20, 2017, 06:55:33 pm
content: Quote from: MagicSmoker on May 20, 2017, 06:29:57 pmCareful with this simulation, it may look like attractive to have fast switching edges (ideal example), but. when current flows through the MOSFET the rules of physics dominate. all the parasitic, LD LS inductance will not yield the same results as shown in the simulation, in fact as an experiment remove the 680R base resistor and place a 10k POT in series now see the effects of the hard switching saturation vs soft switching and observe waveform shape on the scope as you adjust the bias..I actually have setup similar to what I proposed above and the effects are pretty neat.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 21, 2017, 01:27:13 am
content: 1. No current limiting. Good luck if someone shorts the output...2. Opto should come from VREF, not VCC. It's a control range thing: it doesn't need to pull up any higher than it needs to, and pulling up and down symmetrically is the most reasonable choice.3. TL494 needs to be wired as a voltage follower: unity gain at the error amp. Remove R11 and R12, set R10 --> low ohms (or short). The TL431 is in control.4. Also good luck if someone cranks RV1 down to 10kHz when the transformer is dimensioned for 100kHz...5. You can drop R2 and Q1, and move D1 across Q2 so the TL494 emitter does pull-up drive. It's good for 200mA.6. Rsnub1 might be a bit large, and Csnub1 also. They'll certainly be less efficient than a clamp snubber (run a R || D + C from drain to GND). Here's a similar application:This was probably a higher speed, and higher current, application than yours, so adjust values accordingly.The big unknown is the transformer. You'll need the small signal parameters on that (N1/N2, Lp, LL, DCR, Cp), or a winding diagram.7. C5 and C7 are surely going to need to be bigger. A couple 2200uF in parallel should be reasonable.8. The TL431 voltage error amp looks good. R15 and C4 values are YMMV. Select them for best transient load response.It's an okay starting point, but when the UC3843 costs the same and is better in all respects... why not use it?(Or better still, any of the modern SMPS controllers, or regulators, that cost only a little more, but save massively on capacitor and magnetics cost.)Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 21, 2017, 01:32:40 am
content: Quote from: debininja on May 20, 2017, 06:54:45 pmIf you'd like that version, BTW, check out TL598.It's also suitable to drive GDTs (gate drive transformers), though you need to add reverse clamping schottky diodes. The output waveform looks like this,https://www.seventransistorlabs.com/Images/GateDrive1.jpgTim

author: Benta
author_rank: Super Contributor
timestamp: May 21, 2017, 07:59:39 am
content: QuoteI'm not confusing anything, when the output transistor of the TL494 turns off, it's basically open-circuit except for the 100k resistor.Your second suggestion is really bad. First, because it inverts the output logic. Second, because it means the MOSFET will turn on during power-up, before the TL494 is ready to do anything.

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 21, 2017, 08:30:01 am
content: Quote from: Benta on May 21, 2017, 07:59:39 amI suggested open collector because I just discovered that their is a difference between the two configuration not only by nature of their analog configuration i.e emitter follower vs common emitter which I attached as per the datasheet but also how duty cycle behaves, using my configuration on my deskI can only get a only get a minimum duty cycle of 10% (min) up to 100% (max), but in emitter follower mode(like he has), I can get 0%(min) to 80% (max) the datasheet doesn't disclose this behavior for single ended operation.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 21, 2017, 12:20:26 pm
content: Quote from: debininja on May 21, 2017, 04:46:43 amGreat!Attack it from all sides. Practical: breadboard a circuit. See how it works. Discover its drawbacks. Improve it.Analytical: what is a switcher?Hint: you're putting current into an inductor. Control that first! This is why current mode controllers are the only kind that matter.What is a snubber?Hint: as the transistors and diodes turn on and off, you get various combinations of RLC components carrying switching voltage or current. As the switches change state, the continuity condition is that a voltage or current, that had been carried by one device, now gets handled by another.For example, at the instant the transistor turns off, inductor current is carried by its output capacitance Coss, in parallel with the R+C snubber. A moment later, the voltage has risen, and current gets diverted to the output diode instead. Which in turn causes ringing on the primary side (because of where the voltages and currents were), and so on.Control loops: understand what an error amplifier is, and the basic blocks (error amp, "plant", feedback, compensation). Understanding poles and zeroes and stability analysis may be a little much (it's a 3rd or 4th year subject), but at least knowing about those representations will give you a huge kickstart.None of these subjects are insurmountable. The whole may seem intimidating, but it's easily broken down into little pieces. And once you understand those pieces, you gain the whole picture.QuoteIf you don't want to make it explode, I don't want to talk to you anymore.(It is, of course, the loftiest goal of the engineer, to make things that the average schmuck cannot explode. Yes, try as might, they always find a way -- but it's a matter of degree. They have towantit dead!)QuoteIt's capable of 10mA or so. Not a problem.Should also aim for a couple mA on the opto -- the TL431 needs at least 1mA*, and you've got up to ~20mA of headroom (at opto ratings). Less than 1mA quiescent will make it awfully slow (the opto has a lot of capacitance), which can be a problem.*That's what R13 is for, by the way.QuoteIt was probably a design for local regulation (no opto). Typical application has the TL494 on the secondary side, so it senses output voltage directly. (Gate drive signals are then coupled to the primary side with a transformer.)R10 is an aberration -- it reduces error amp gain, which means the DC output voltage won't be perfectly stable, but will vary with load.Reducing gain was a common technique to improve phase margin, a big problem for voltage-mode controllers like this. But that's handily solved by using current-mode control -- another point for the superior method.But yeah, you don't want the TL494 error amp(s) being error amps -- that squares the loop gain, making it impossible to stabilize. (The TL494 would be attempting to control its output, so as to regulate the opto's output at 2.50V. Simultaneously, the TL431 is trying to control the TL494 so as to regulate 5.0V DC output. Who wins?)QuoteNa, FBT's fine -- it's made of wire and iron . You can short that sucker for seconds at a time.Poor little Q3 will expire in a few hundredmicroseconds.You can put a fuse in the supply, but keep in mind, those blow inmilliseconds. So Q3 is dead a hundred times over and then the fuse blows...Except for very few situations (that are engineered accordingly!), fuses are only ever for fire protection -- when Q3 dies shorted, you don't want it taking out all your wiring and stuff. It's a good idea, even for prototyping... especially for prototyping? But kind of annoying, so an active current limiting circuit is a bit more handy.(There are also self-resetting fuses, which work fine at this voltage and current level.)Quote2N3904 is only 200mA, too.You can push them harder than that, but it's ugly. In this circuit, as shown, if the gate were quasi-shorted*, it would probably deliver around 500mA (200 from the TL494, 300 from the 2N3904 -- yes, driving it so hard, hFE = 1 or 2!).*You wouldn't want to test with an actual short circuit, but a heavy load, like 0.1uF (and no 4.7 ohm R4), would rise slow enough that you can see how much current it's dumping in the process. (Some gate driver ICs use this test method!)But IRF540 isn't a big deal, and 200mA will be more than enough.Indeed, the TL494 output risetime is a whopping 200ns or so. If IRF540 were 20nC gate charge (at 10V, that comes out to 2nF equivalent average Ciss), it would only draw 100mA during the rising edge.Fundamental capacitor equation: I = C * dV/dtInductor: V = L * dI/dtBoth of these apply very usefully in switching circuits, because the waveforms can all be diagrammed as square waves and trapezoids.QuoteHow do you figure?Hello, Ladies and Gentlemen, and welcome to another episode ofWhen is a Component Not a Component?Today, courtesy of out poster above, we have the:Electrolytic Capacitor!Okay, anyway... so, where is it true that a capacitor is a pure capacitance?. . .In the SPICE simulator and nowhere else.A real component is always a complex mixture of R, L and C. How complex?...How close do you need to look? This is an approximation thing. Normally, you'll only bother with three series components: the capacitance, resistance (ESR), and inductance (ESL).Since no real component is ideal, we simply call them what they are, when they show that characteristic over a useful frequency range. Resistors are resistive from DC to ~MHz (wirewound) to ~GHz (film), so they're quite practical resistances. Film and ceramic capacitors are capacitive from very low frequencies (~mHz) to high frequencies (MHz to GHz). Inductors, well, they come in so many kinds, but the point is they're still usefully inductive over some range as well.So what's the dirty little secret about electrolytics? They have relatively high ESR.You would hope for 100uF to be 16mohm at 100kHz, but in reality, you'll probably get ESR around 0.3 ohm in series with that. This isnota frequency where an electrolytic capacitorcapacitates!(At lower frequencies, where Xc > ESR, it does look capacitive. Electrolytics are good in the mHz to maybe 10kHz range: it's not a very wide range, which shows they're not very good capacitors. We put up with them because they're big and cheap.)And even then, 0.3 ohm, that's pretty good, that's 0.3V at 1A, right? Well...Keep in mind, if this will be a DCM (discontinuous conduction mode -- the inductor current rings down to zero before the switch turns on again) circuit, then the most output duty cycle you can have is 50% (for an optimal transformer ratio), and that means, half the time, D2 is delivering zero current. So the average currentduring conductionis double, or 2A. And the inductor current is a ramp, so it has to start at4Aand discharge to zero during that time! So your actual peak current isquadruplethe output average.(This is why flyback converters aren't very common above about 100W, by the way. It just takes so many electrolytics to filter all that ripple, that it's worthwhile using a more complicated circuit, usually a full wave forward converter.)If you're in CCM (continuous conduction mode), the best you can possibly do is 2A peak, but in reality it'll be somewhere inbetween, because the inductor current starts at, say, 3A (when switch turns off and diode turns on), then discharges to 1A (when switch turns on again, yanking the diode off). The amount of inductor current ripple is set by operating frequency and transformer inductance.So for the worst-case situation, 4A peak, you'd have around 1.2Vpp ripple. Yeah, you've got an LC filter on there that can quiet that down nicely, but, that poor C5 will have to bear 1.5Arms of ripple current, whereas I don't think you'll find one that size that's rated for much over 100mA. It'll gettoasty!1000uF and 2200uF caps are plentiful though, with ESR under 0.1 ohm and ripple current ratings around 1-2A. Excellently suitable here.QuoteNope! Just set up, guess what, another switching circuit!This is so simple,I'deven recommend a 555 for the job: you need an audio frequency square wave (low kHz or below), and a MOSFET that switches a resistor load.Normally, you'll have an idle load as well, so one load resistor connected at all times, and another switched by transistor. This way, the SMPS is always running, it's just running at, say, half and full throttle, alternately.While that's tugging away on the output, watch the output voltage with the scope. (You may want to select AC input coupling, so you can zoom in closer on the change.) You'll see it dip and stabilize, and overshoot and stabilize, with each edge.Or maybe it doesn't stabilize, but then you'll know...You should pretty easily get a feel for what different values of R15 and C4 do. You should find that, as you increase R15, you generally get more phase margin, so that C4 can be smaller: your loop is responding faster! As you adjust the values, you'll find a region where R15 is "about right", and C4 can't be made any smaller without making the output really lumpy. This is about where you want to be. For a safety factor, you can slow it down a bit by doubling C4, more or less, which will account for things you didn't test for initially -- reactive loads, capacitive loads, that sort of thing.Too slow of a control loop means you need much bigger filter caps than otherwise, and that the output voltage changes an awful lot in response to load changes.Tim

author: Benta
author_rank: Super Contributor
timestamp: May 21, 2017, 06:51:11 pm
content: QuoteThe best idea would be to limit postings to something you have knowledge of.On the TL494 you're obviously clueless.I apologise for being rough, but this kind of noise helps nobody.

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 21, 2017, 07:43:39 pm
content: Quote from: Benta on May 21, 2017, 06:51:11 pmWhats your problem?, don't apologize then badger people, you clearly looking for trouble, please piss off. I have enough knowledge using the chip (i don't claim to be an expert) but you forcefully claim be one.. the fact that you didn't know a totem pole driver is the suggested drive circuit is concerning, very.Don't talk to me like I need your approval, you far from fit being a judge, you been clearly seeking attention since this post was created. whats wrong with you? this is a fair forum take your attention seeking manners somewhere else.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 22, 2017, 06:54:59 am
content: Oops, cut the link between pin 3 and 13, otherwise that covers most of it.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 24, 2017, 03:49:42 am
content: Huh, check U2 footprint...No ground plane, but it's so slow, it's probably fine. If nothing else, you'll get to see how bad it can be without.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 25, 2017, 06:13:18 pm
content: How exactly do you have a closed-loop power supply operating into a lightbulb?SMPS is not something you develop without a scope on at all times.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 25, 2017, 07:56:30 pm
content: Oh, it's hard wired for adjustable PWM, it's not the rest of the circuit?Tim

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 25, 2017, 09:02:09 pm
content: Quote from: debininja on May 25, 2017, 04:13:14 pm1) Those "stranded wires" (from Ebay) is not going to help you, consider using solid core wire to carry signals and keep them short, those wires are prone to cause all kinds of issues its not worth it.2) A MOSFET will naturally resonate as a switch (and enforces good layout) , I would highly recommend you rethink your geometry and layout, keep high current paths short, use thicker short wire and use a matrix prototype board for the power MOSFET, tin the high current paths with solder, I cannot stress how important this is.3) I would recommend you rethink your switching frequency, 100KHz switching frequency is tough to tame with wires dangling around, this introduces all forms unwanted resonance in the switching spectrum, consider using a moderate 30KHz and work your way up (slow) which will save you all kinds of menace, your RC snubber is highly lossy you need to calculate the values "after you reconsidered your layout" see attachment I have a tiny RC snubber with very low loss, but that's cause the layout imposes how much snubbing is required.I have attached an image of something I was building a few days ago using the same controller as you, my prototype is able to adjust the PWM drive from (0% to 90%) FREQ (10KHz to 250KHz) and drive the power FET using a inductive load, however even at 100KHz it puts a demand on the layout as a result of the wires and geometry. Also note I used a SMD cap and resistor right at the leads between the Drain and Source to combat resonance at approx 100MHz. You can see a nicely a burned carbon resistor of 100R used to reset the inductor energy.(Not clearly shown is a BD139/140 totem pole driver with adjustable current drive to further tame the drive via a multi turn pot)The recommendation is to use your oscilloscope to death. you seem to have a handle with mathematics which is good but layout will throw all your calculations out

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 30, 2017, 06:03:04 am
content: Good progress. Your waveform looks good. try to take a waveform snapshots of the mosfet Vgs, Vds.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 30, 2017, 04:08:03 pm
content: You need to check if the ferrite will saturate.Peak flux density Bmax = V*dt / Aedt is maximum switch on-time (for DCM), V is applied voltage, and Ae is the effective cross sectional area (core datasheet).For CCM, the total V*dt is integrated over many cycles, so it's easier to reference it by peak current. (Current works equally well for DCM, too.) In that case, the expected flux is:Phi_max = L * Ipk = V * dtNote that H has units of Vs/A, i.e., inductance converts flux (applied volts * time) to the current flowing through the inductor, or vice versa. It's Ohm's law, time-dependent. (As well it should be, because a linear inductor is linear in the same way a resistor is.)Ferrites saturate in the > 0.2T range, with the most common MnZn types going up to 0.4T or so. They get hot when operated at this flux density, cyclically, though. It may be more practical to choose 0.1-0.2T for a core of this size, at this frequency.This also allows you to calculate the gap.The minimum gap, and therefore the minimum number of turns as well, is given by:N = V * dt / (Bmax * Ae)Bmax is whatever peak flux density you choose.Alternately, V * dt = V / (2 * F) for a 50% duty cycle unipolar circuit (like this flyback), or change the 2 to 4 for a bipolar circuit (e.g., the typical half bridge forward converter), or to 4.44 for a sine wave of Vrms.Flux is determined completely independently* of inductance. Inductance is determined by the ratio of Ae to l_e and the core properties.L = A_L * N^2A_L = mu_r * mu_0 * Ae / l_e*To the first order. Second order effects, like fringing flux and leakage, have a small effect (~10%), so "complete" isn't very complete at all. But those effects are additive, so the results from this assumption are conservative.We can now take this in two directions: when we introduce an air gap, we can say we're reducing the effective permeability. This holds l_e constant, and varies mu_r. In that case,mu_eff = l_e / (l_g + l_e / mu_r)And we use this value for mu_r in the usual A_L formula.Alternately, we can say the effective length isallair gap, in which case mu_r = 1 (because we're taking air equivalent), and the core's contribution is l_e / mu_r. (In effect, the fact that the core has high permeability, means its length is short-circuited by the same factor. This is why cores are so helpful!) This way, we get:A_L = mu_0 * Ae / (l_g + l_e / mu_r)One final alternative, that's somewhat separate from these: we can calculate the amount of air gap we need, in the first place. Air gap stores energy, and the energy density in that gap is given by:e = Bmax^2 / (2*mu_0)The cross section of the gap is Ae (usually slightly more, for the same exception above*), and the thickness is the gap (or, the gap plus the core's effective air gap length l_e / mu_r, since we now know about that). The energy in an inductor is 0.5 * Ipk^2 * L. Smooshing all these together allows us to solve for the required gap, without knowing anything more about magnetism and cores.I would strongly suggest avoiding electrical tape (the vinyl stuff), because it's squishy and melty. Polyester and polyimide tapes and films are fine, or you can use paper in a pinch, if you don't mind that it's not exactly UL94V-0 self extinguishing.Tim

author: MagicSmoker
author_rank: Super Contributor
timestamp: May 31, 2017, 06:45:25 pm
content: Waveforms look pretty good to me, especially for being on a veroboard. I annotated one of the scope shots:

author: diyaudio
author_rank: Frequent Contributor
timestamp: June 01, 2017, 06:35:31 am
content: Quote from: MagicSmoker on May 31, 2017, 06:45:25 pmI don't agree with your annotation on the Vgs waveform.That's not typical for a Vgs signal. He's waveform needs to have the typical miller charge characteristics, with minimal overshot (with correct snubbing in place) see attached example for Vgs (Voltage Drain to Source) notice in the example the typical steps during the different miller charge for turn on and turn off times. You need to learn how to tame your waveform, you might also have to look at Soft Switching vs Hard Switching. (fast turn on interval is NOT important for this project) You also need to use a different ground clip when probing Vgs signals, loose that clamp clip and use a solid wire to ground for probing. Dave has done a video on this subject already.You are still using thin Ebay wire to supply power to the breadboard and then to the mosfet board, that is probably one of reasons why you have such a large stray inductance, also your transformer has leakage inductance causing the ringing, you still need to inspect and measure this and work on your transformer winding, measure and snub where it applies.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 01, 2017, 12:48:57 pm
content: Quote from: diyaudio on June 01, 2017, 06:35:31 amYabbut he didn't annotate Vgs?QuoteThe Miller step is visible on the rising edge. At this scale, it shows as merely a brightening of the beam, but that's one plus of analog scopes (or sufficiently accurate and oversampled DPOs). The falling edge step kind of gets lost in the ringing junk, and may be fairly weak due to the nature of the driver circuit. Later (during the free induction ringdown), the baseline ringing is due to Cgd and unclamped Vgs. The driver has a +/- 0.7V deadband, which is fine.Tim

author: MagicSmoker
author_rank: Super Contributor
timestamp: June 01, 2017, 01:22:58 pm
content: Quote from: diyaudio on June 01, 2017, 06:35:31 amProbably because I was commenting about theVdswaveform...

author: diyaudio
author_rank: Frequent Contributor
timestamp: June 01, 2017, 01:47:15 pm
content: Quote from: MagicSmoker on June 01, 2017, 01:22:58 pmsorry. hahaha

author: diyaudio
author_rank: Frequent Contributor
timestamp: June 01, 2017, 08:11:04 pm
content: Quote from: debininja on June 01, 2017, 02:00:04 pmIMHOThe best way to uncover the mystery's of known OR unknown magnetic specifications for SMPS (and you don't have to build this now) is build a saturation test rig with variable Frequency and Duty Cycle adjustment, that's what I showed a few posts ago.I'm able test and verify core saturation levels with optimal frequency (for any material SMPS Transformer OR Inductor) and trace the numbers back to the datasheet (if its available), this is my preferred technique, I've have had good success thus far and tested custom wound transformers on a ETD49 EPCOS core and commercial grade magnetic components with supplied datasheet figures and the numbers are always spot on. Using brute force esoteric math calculations is cumbersome.

author: diyaudio
author_rank: Frequent Contributor
timestamp: June 01, 2017, 08:47:14 pm
content: Quote from: debininja on June 01, 2017, 08:33:18 pmI don't actually have one for good reason (cause its dead simple to make) using a TL494 replace the oscillator section with a pot for variable frequency adjust and apply a voltage from 0 ~ 3.3V to the DT PIN for duty cycle adjustment now you have variable frequency and dead time adjust, use a power fet I used a (50n06 I had 10 laying around) and a non inductive resistor in series with the drain to obtain and sample the current ramp. There are so many variants of this circuit using a TL494 is over kill, you can even use a one 555 timer as shown here.https://hackaday.com/2013/10/28/making-a-power-inductor-checker/

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 01, 2017, 11:06:07 pm
content: You've seen half a dozen different formulas, but realize they're all different rearrangements of the same fundamental equations.All of which go entirely by definition, so dimensional analysis is 100% accurate here!So, flux density? That's density by area, so, flux per area. In mks units, use V.s / m^2 == T. Or replace m --> mm and s --> us, which is more handy for SMPS. (This also uses MHz, uF and uH.)There's a run-down of basic definitions here:https://www.seventransistorlabs.com/tmoranwms/Elec_Magnetics.htmlSaturation flux density is in the datasheet. It's a bulk material property, so if it's not in the core datasheet, check the material datasheet (e.g. 3C90). The flux density values they give in the inline table is kind of a recommended operating point: they specify the power dissipation under that condition, which as you can see, is pretty modest (under a watt). A core that size would be sweatingat1W, so you'd want to use less power than, whatever Bmax gives 1W... (to figurethatout, check the material datasheet for core loss vs. flux density). The values they give are usually somewhat conservative, so you can run, say, 200mT at 100kHz without much worry.Or you can always run at lower Bmax, as long as you don't mind needing the extra turns, and reap the rewards of lower losses.Tim

author: MagicSmoker
author_rank: Super Contributor
timestamp: June 02, 2017, 12:44:28 pm
content: There are many different approaches to designing a flyback converter depending on whether you are using an off-the-shelf transformer, a random core from the junk pile that looks about right, or a known core purchased from a reliable distributor. For the beginner in SMPS design the 2nd option is the worst because of too many unknowns.The first thing to keep in mind about the flyback transformer is that it is really a multi-winding coupled inductor, and not a true transformer per se (but everyone calls it a transformer anyway, including me). This is because current is only flowing in either the primary or the secondary at any given time, never both, so each winding acts like an inductor. The second important point is that ALL of the energy delivered to the output has to be stored in the flyback transformer first. The third point is that the windings are all linked together by conservation of amp*turns (AT or A*T)and so the primary acts like a current sink (storing energy in its inductance) while the secondary acts like a current source. The upshot of this is that the relative voltages across each winding will be fixed by the turns ratio - as in a true transformer - but the absolute voltages are not fixed, just as is expected of a current source.For example, if current ramps up from 0A to 10A in a 10t primary while the switch is on, then the current exiting the secondary immediately upon switch turn off will ramp down from a level of (10A * 10t)/Nsec. If the secondary is 1t then the current will attempt to ramp down from 100A; if the secondary is 20t then current will ramp down from 5A, etc. Of course, for current to flow in the secondary there needs to be a load across it, andit is the load resistance which sets the output voltage!So if the secondary winding has 10t - same as the primary - and we put a 1R resistor across it then the peak secondary voltage will be 10V. How about a 100R resistor? Well, to get 10A to flow through 100R you need 1kV... Hence one of the reasons why the flyback is so popular for high output voltage applications. It's also why you never want to run a flyback unloaded if the controller IC can't do pulse-skipping or otherwise shutdown the switch drive signal if the output voltage rises too high.There Ain't No Such Thing As A Free Lunch, however, and in this case the voltage across the secondary when its diode is conducting is reflected back across the primary through the turns ratio, and this reflected voltage, plus the input voltage, is what the switch must withstand when it is off. Similarly, when the switch is on the voltage across the primary is reflected across the secondary through the turns ratio and adds to the voltage the secondary diode must withstand (on top of the output voltage). Hence why I said the relative voltages across each winding are always enforced through the turns-ratio, even if the absolute voltage transformation ratio is not fixed.All this means that we use the inductor equations to design the primary of the flyback transformer, and then select an appropriate turns ratio to trade off peak currents and voltages in both the primary switch and the secondary diode. If we use a step-down ratio then we reduce peak primary current (when the switch is on) but increase peak primary voltage (when the switch is off off), and vice versa for the secondary diode.The relevant equations for an inductor are:E in Joules = 0.5LI² (where E is in uJ if L is in uH and I is in amps)L * dI = V * dt (where L is uH if dt is in us and dI is in amps)However, the wide range of flexibility in duty cycle, frequency, turns ratio and even inductance in a flyback can make it somewhat maddening to design, so the best approach to take will depend on initial limiting conditions. For example, if you are using a salvaged core that you don't have full specifications on - and especially if you are manually introducing an air gap - then you might need to make frequency a dependent variable to achieve the necessary power throughput (a word of advice: your life will be much easier if you use pre-gapped core sets from DigiKey, Mouser, etc.).Duty ratio is also a bit of a wild card in that the maximum allowed by the controller IC (e.g. - the TL494 is 45% per output) is not necessarily the limit when a flyback is in DCM. For example, duty Cycle in a transformer isolated flyback with a Npri:Nsec turns ratio specified by n is:D = (n * Vout) / ((n * Vout) + Vin)So if the transformer has a 2:1 step down ratio (ie, n = 2) and Vin is 10V then the calculated duty cycle is 0.50, which means the switch on time and diode on time will be equal. In discontinuous conduction mode (DCM), however, all of the windings go to 0A for some portion of each switching period, so it would be perfectly reasonable for switch on time to be, say, 7us and diode on time to also be 7us, but total period at 50kHz is 20us, so that means for 6us each switching period all of the windings have stopped conducting (but then you get the infamous DCM ringing, as I pointed out previously). The way you ensure DCM is by *lowering* the primary inductance (which also causes peak current to rise).Use the website below to play around with turns ratio, frequency, inductance, etc., in a flyback:http://schmidt-walter-schaltnetzteile.de/smps_e/spw_smps_e.htmlJust ensure that Ton doesn't exceed 9us at Vin and 50kHz fsw, of course.Faraday's equation - the one you have found in a wide variety of formats - is only needed to check that the flux swing isn't too wide, leading either to saturation (which is disastrous) or just excessive core loss (which in most ferrites is proportional to around the 2.5 power of total flux swing).Finally, there are pre-gapped ferrite cores available commercially which are usually specified by ALin nH/t², and this usually assumes the use of one unground half and one ground half. Needless to say, pre-gapped cores are going to be a lot more predictable and consistent than attempting to insert spaces between ungapped cores you salvage. Also beware that magnetic amplifiers are commonly used in ATX power supplies to derive lower voltage rails without requiring another winding on the transformer and the cores that are used in this application are extremely unsuitable for use as flyback transformers (or regular chokes).EDIT: Changed N -> n in formula above

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 12, 2017, 07:20:28 pm
content: To myself: "You're going to be disappointed with that windup..."Then I read "60V peaks".Well, yeah.Better? Well, there's that at least.As long as you're going to use doubled up wire, you can do it in single layers each. One layer of primary, tape, one layer of secondary, tape, primary, tape, secondary. Connecting layers in parallel reduces the impedance further.As shown, impedance is probably something like 200 ohms, but system impedance is around 5 ohms. The huge mismatch manifests as leakage inductance, hence the peak. Basically, the leakage is (200/5) times worse than it needs to be.What does the current waveform look like?Is the winding phase correct?Tim

author: jbb
author_rank: Super Contributor
timestamp: June 12, 2017, 08:20:53 pm
content: As T3sl4co1l said - leakage inductance is responsible for those big spikes.Leakage inductance is very dependent on winding geometry, which is why an interleaved winding can help.Here's my suggestions:In many ways an ideal winding exactly fills the width of the bobbin in one layer. This gives a nice flat surface to wind the next layer on and also reduces intra-winding capacitance.A layer of mylar tape between layers makes it much easier to keep the next one flat.Where leakage inductance is critical, interleave the windings (see below).Note windings often take a little more space than you expect. This can be due to things like the copper distorting as you bend it over a 90 degree angle.You'll see things written about fill factor. Some handbook will tell you that 0.7 is possible. I suggest you don't try to go higher than 0.5 without some practice.Make 'em look all pretty and nice. Scrappy windings can have unpredictable parameters or other problems.For 2A RMS maximum, youmightbe OK with a single strand of 0.5mm diameterWinding option A:10Tape9S213 turns 0.5mm dia8Tape7P214 turns 0.5mm dia6Tape5S113 turns 0.5mm dia4Tape3P114 turns 0.5mm dia2Bobbin1CoreThen wire P1 and P2 in parallel, S1 and S2 in parallel. This might give you some troubles with circulating currents, though, because (P1 and P2) and (S1 and S2) follow different paths through the magnetic fields inside the winding pack and therefore could develop different Electro Motive Forces (EMFs). Different EMFs can lead to currents circulating through the windings.Winding option B:10Tape9S26 turns 2x0.5mm dia8Tape7P27 turns 2x0.5mm dia6Tape5S17 turns 2x0.5mm dia4Tape3P17 turns 2x0.5mm dia2Bobbin1CoreThen wire P1 and P2 in series, S1 and S2 in series. Because the parallel windings are right next to each other (similar to what you've wound already) you can be pretty confident you won't have circulating current problems.Caution: you cannot rely on single-insulated enamel wire (aka magnet wire) for safety. This is because the enamel has little pinprick holes in it, which can rub through into short circuits (rare but possible). If you need safety insulation (e.g. to get from mains to a human-touchable circuit) the transformer design needs a lot of careful attention.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 12, 2017, 09:43:24 pm
content: Yeah, series windings are usually better. You can get away with many strands that way, 2 or 3 or even 4 strands, laying flat together (make sure they don't overlap). Or copper foil / tape (but you'll need to add insulation), which is fantastic for high currents.Also, don't use vinyl "electrical" tape: it's very stretchy, and melts at a low temperature. I would rather use masking tape -- it's paper, which is bad, but paper was used back in the day, and paper doesn't ignite until higher temperatures (class A insulation). Ideally, polyester (class B I think) or polyimide (class F? good for >200C!) should be used.Without varnish filling the gaps, it's also a good idea to derate the wire size further. Not a big deal on small transformers like this, but you'll notice things getting much hotter as you go up in size.Tim

author: diyaudio
author_rank: Frequent Contributor
timestamp: June 12, 2017, 09:53:37 pm
content: What's up with strange PI filter and the feedback node before the output inductor? Surely this isn't correct. ? as a measure I would use a pot and adjust the duty cycle to the max (0.4) to confirm your transformer is working correctly at maximum load regulated so the process of elimination can begin. You have two problems remaining.. transformer efficiency verification and voltage mode feedback verification (with compensation) both can be tested independently.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 13, 2017, 08:12:37 am
content: Feedback before the LC assists with compensation.Tim

author: jbb
author_rank: Super Contributor
timestamp: June 13, 2017, 08:12:26 pm
content: Quote from: debininja on June 13, 2017, 01:14:01 pmWell, I can't speak for others on the forum, but it's nice to see someone deliberately working through something challenging. I'm sure you've learnt a lot! Flyback supplies are common, but actually surprisingly tricky.Quote from: debininja on June 13, 2017, 01:14:01 pmThat efficiency's not bad at all for a not-particularly optimised converter. Moving to a proper PCB might help a little - but is it worth it to you? Once you get the TL494 feedback behaving properly (which should be fine on the prototype board) you've gotten most of the learning out of it, and it looks pretty tidy. However, laying out a proper PCB could be good practice too.Quote from: debininja on June 13, 2017, 01:14:01 pmNo worries there - that's just 'warm' rather than hot.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 15, 2017, 01:37:00 am
content: That's not a zener, that's a Vbe multiplier. The voltage might be stable enough, but the tempco, hoo boy...You aren't going to improve on the TL431; you can mimic it, but you'll end up with whatever problems you had in the first place, but worse because it's discrete instead of integrated.In short: fix your problems first.The spikes come from dI/dt at the rectifier (and dV/dt at the transformer, if it's common mode), feeding through because of capacitor ESL.Solution? Add ferrite beads in series with the line(s), and bypass with a ceramic cap.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 17, 2017, 10:22:45 pm
content: Quote from: debininja on June 17, 2017, 09:13:25 pmThis calculation is for a 0.6V drop at 0.25A, but where is the 0.25A going? It can't just dead end.It has to go on to ground, sooner or later. So you have another 5.1V * 0.25A = 1.25W somewhere, in order for this to be valid.But at 0.25A, the supply isn't at 5.7V anymore, so the 0.6V drop doesn't actually exist anywhere. (Classically, it would be dissipated within the Thevenin source -- but with switching and reactive power flowing around, there's no particular reason to believe the drop is due to an internal resistance that dissipates real power! AC is fun like that, eh?)So you just have / need the 5.1V * 0.25A load.You might look into sharpening the gate drive, see if that improves the minimum pulse width. Also, what it's doing near cutoff, if it is oscillating or going chaotic or what.Also, make sure the TL431 and opto aren't saturated. Note that TL431 can't pull down below about 1.9V (can you figure out why?).As for the zener: that's usually for clamping, or TVS protection. It could also be for minimum load. It's worth noting, adapters usually have crappy regulation -- no TL431 + opto, just aux winding feedback -- so the output can be even more wild than what you've got here.Better supplies often have a crowbar: a zener or separate TL431 triggering an SCR that shorts the output if it rises over so-and-so.QuoteMmmh, maybe, but it's a brute force way, and isn't friendly to the transformer and transistor.Tim