Bidirectional TVS a better choice? - Page 1
Forum section: electronics / beginners

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 12:25:08 pm
content: Hi,I've got a bit of a problem with a circuit. It all works fine at regular loads (1 ohm +) but when the load is very low, say 0.35 ohms, it destroyed the bypass cap on the input side of the 7805 on the board. The VCC is 12V and I used a 16V tantalum, which I now know was a bad idea. I've replaced it with an expensive 63V aluminum can capacitor and now it works fine even at low loads, but, my thoughts drifted into what caused it to go bang to begin with. The load is a very small heating coil, which of course will be inductive, high side driven by raw PWM (no smoothing) using a p-channel mosfet. Now I know this will be an absolute nightmare for back emf, so I put a shokkty across the load, but thinking about it, I don't see how this would help anything. A forward spike would just go straight to ground and a reverse spike would travel back up the internal diode on the fet into the PSU and thus into the bypass cap on the 7805, which is what I think caused it, either that or spikes directly from the PSU.My thought was, if I put a bidirectional TVS across the load (and across the PSU input), say 13V min 21V clamping, would this keep the spikes to within a manageable level? The TVS is shown as two back to back zeners and the mosfet driver as a schmitt trigger in the diagram as the package I used to draw it didn't have the parts in the database.

author: Simon
author_rank: Unknown
timestamp: September 23, 2014, 12:30:07 pm
content: Bidirectional TVS diodes would be for AC really. You want a uni-directional, this way for negative spikes it acts as a back emf diode but for positive ones it limits them. You don't want any negative spikes getting back into your circuit do you make them circulate around in the back emf diode and the load.

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 12:37:41 pm
content: Thanks Simon. I'll order some unidirectional ones. Do you think I should put one on the psu input as well, in the diagram I used a battery but it's actually a switch mode 12V power supply I'm using. I was worried that the PWM might be causing spikes from the PSU as at such low load resistances it is actually over driving the PSU, but it has such a high pulse current rating (If I turn it off, the circuit runs on idle for about 2 minutes before the caps in the psu discharge fully) so I thought it should be fine so long as my average current draw doesn't exceeed the PSU's rating, but now I'm not sure if it's causing noise in the supply line.

author: Simon
author_rank: Unknown
timestamp: September 23, 2014, 01:12:07 pm
content: If you have a heavy load in particular one that exceeds the rating on the supply albeit for a very short period make sure you have a large output capacitance, although try and use a few in parallel instead on one big one. The output capacitors help hold the voltage while the regulator gets it's head around and responds to the sudden load increase.

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 01:18:22 pm
content: I currently have a big 10mF on the output at the moment. I take it the different values will help to filter the different frequencies better? Am I right in thinking high power square waves will cause a huge amount of harmonic noise? Square waves cause harmonics of higher frequencies that gradually drop in amplitude if I remember one of Dave's previous videos on this subject? Although the regulator is not being asked to do anything heavy during the time the load is being fired, that just supplies power to the MCU, the load is driven directly from the VCC.EDIT: Oh you mean the regulator in the PSU, sorry. LOL.

author: Simon
author_rank: Unknown
timestamp: September 23, 2014, 01:24:50 pm
content: Well yes whatever supplies the load. your load if inductive may have a self resonant frequency that it may try to oscillate at it's the sort of thing than can be hard to know unless you have data on the load.

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 01:43:29 pm
content: Well that's the thing, the load is replaceable and can vary from 200 milliohms up to 6 ohms depending on the user, plus the loads are usually hand built, they're basically coils of Kanthal wire that the users construct themselves (sometimes 2 or more in parallel), so accurate data on the load is impossible, so as many different value caps as I can fit in the box seems the best option.Cheers Simon, I appreciate the help.

author: Simon
author_rank: Unknown
timestamp: September 23, 2014, 01:48:45 pm
content: If you have the load clamped your input should be ok

author: Rufus
author_rank: Super Contributor
timestamp: September 23, 2014, 03:16:30 pm
content: You don't need a TVS diode across the load.When the MOSFET turns off current flowing in the stray inductance of the VCC line (and ground return) causes a +ve spike on VCC at the MOSFET end. That is probably what killed your tantalum capacitor, that or if the power supply is a bit crappy it might spike up when a heavy load is quickly removed. You need a TVS diode and possibly more capacitance across VCC at the MOSFET end.If the load is inductive (and it will be at least a bit) turning off the MOSFET causes a -ve spike on the MOSFET drain. If it breaks down it continues to draw current from VCC actually reducing spikes on VCC. A normal diode across the load at the MOSFET end allows current to continue to flow through the load dissipating energy stored in the load and stray inductance.You ought to put a resistor in series with the MOSFET gate to slow it down (100R, 1k?). It is the high rate of change of current which generates voltage spikes in these inductances. MOSFETs in circuits with stray inductance tend to oscillate at RF frequencies, a gate resistor stops that as well.Slowing down the MOSFET causes more power dissipation during turn on and off so it will run a bit hotter, don't use a higher PWM frequency than you need to.

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 03:58:16 pm
content: I use 31.25kHz as that's the lowest inaudible frequency the MCU will generate. Anything lower and there's an awful noise comes from the unit and the load (rattlesnaking / buzzing). If I slow down the mosfet switching at that frequency, then the PWM will be completely ineffective, even at 2 or 3% I'll have the mosfet on all the time, this is the reason I had to use a mosfet driver instead of a simple npn/resistor pull up configuration, it was just too slow. In the early version of this device (there have been 3) I used about 30Hz, and it sounded like a kid riding a bicycle with a lollipop stick stuck in the spokes. Higher frequencies became a tone and inaudible frequencies didn't work because the mosfet couldn't switch on and off quickly enough. So a major design change in the later version was to specifically get it to work at high frequencies to stop the noise and stop the mosfet from overheating in seconds which it would do switching a load of 350 milliohms with sloping gate voltages. Bear in mind as well that the usual duty cycle being used is about 10% so I'm effectively needing a gate response of 300kHz. The only other option I have is to actually smooth the output with an inductor/cap/diode which is next to impossible at 31kHz, I'd need at least 100Khz to get an inductor suitable for the job and the MCU cannot go that high.So I should put the TVS across the mosfet source (Which is VCC but physically close to the source pin?) and ground, rather than across the load?

author: Rufus
author_rank: Super Contributor
timestamp: September 23, 2014, 06:09:03 pm
content: If you switch 5A in 10ns the self inductance of 1m of straight 18 awg wire will produce a voltage spike of around 250v. If you are switching high currents fast you need to consider small inductances. You can easily kill MOSFETs switching high currents fast with a bit of stray wiring inductance.A TVS diode to clamp the spike needs to go at the end of the inductance where current is switched, or across the thing you are trying to protect which probably includes the MOSFET. A few uF of low inductance capacitance would also mostly absorb the spike and help not put a hole in VCC when the MOSFET turns on (but load inductance helps reduce the rate of change of current on turn on so the turn on dip won't be as significant as the turn off spike).A normal free-wheeling diode across the load and wiring inductance is still likely required, again at the end of the inductance where the current is switched.

author: timb
author_rank: Super Contributor
timestamp: September 23, 2014, 06:19:31 pm
content: Quote from: Boltar on September 23, 2014, 01:43:29 pmThis sounds like a *really* powerful eCig mod!Sent from my Smartphone

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 06:24:46 pm
content: Quote from: timb on September 23, 2014, 06:19:31 pmIt is indeed, lol. Here it is in operation, this was before the cap killed itself.Rufus, so the TVS needs to go across the mosfet? I don't need to protect the load, it's just a bit of wire. And when you say "A few uF of low inductance capacitance" do you mean a snubber? A Film cap and a resistor? Again across the mosfet? I don't really understand what you mean when you say "At the end of the inductance". Sorry.

author: timb
author_rank: Super Contributor
timestamp: September 23, 2014, 06:29:39 pm
content: The atomizer is the inductance.Man, that thing looks like a beast! And here I am still using a two year old "Kicked" mod from Evolv in a generic 18650 non-eGo tube. I should build my own mod!Sent from my Smartphone

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 06:36:39 pm
content: Yeah I just didn't understand "The end of the inductance", does that mean the end connected to ground or the end connected to the fet drain?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 23, 2014, 06:38:36 pm
content: 0.2 ohms at 12V is a freaking 60A pulse, no wonder the tantalum grenaded. If you require the circuit to be stable for any load in that range, you're going to have a hard time...At 60A, it doesn't take much inductance to kill the MOSFET, if it's going fast. You didn't mention what IC1 is, though.Even if the MOSFET is perfectly happy (no inductive spike causing avalanche, or going slow enough to absorb it), that much ripple (PWM at 31kHz means it's going on and off, i.e., the bypass capacitors have to supply 0/60A alternately for ~16us at a time) means plenty of amps RMS going right through the cap ESR. A 20mohm ESR cap with 60A pulses will drop 1.2V (i.e., the supply droops from 12.0V to 10.8V, during the pulse); a small cap with > 0.2 ohm ESR will drop more than half the supply voltage -- a poor 10uF tantalum will be destroyed in no time with its many ohms ESR!The formula for RMS from a pulsed source is: RMS = pk * sqrt(D)where D is the duty cycle (t_on / t_cycle) and pk is the current while it's on (zero elsewhere).This works recursively, so pk can be the RMS during the on-time, if it varies (so you can use this to find the RMS from a half-wave rectified sine (which is a sine hump, then zero elsewhere), or a triangle (often encountered in SMPS), etc.). Probably, your resistive element isn't changing much while it's on, so you won't need to worry about this.Then, find a cap with ripple rating high enough to handle this. Place it (or them, if you end up needing many in parallel) as close as possible near the transistor, and place the snubber or TVS as close as possible to them. You're protecting the transistor, not the load.Tim

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 06:54:36 pm
content: Thanks T3sl4co1l. Yeah, 0.2 Ohms is a bit too low to be frank. The cap died with a 350m load although with the newer cap it's not died yet, but there's still time. IC1 is nothing, it's a representation of a mosfet driver, the model I used isn't in the database of the package I used to draw the diagram. It's actually a TC4426, which is a low side driver, but it's inverting (output is at VCC when input is 0V and vice versa) so it still drives a p-channel ok. Film caps have low ESR don't they? Would they be best do you think?

author: DanielS
author_rank: Frequent Contributor
timestamp: September 23, 2014, 07:16:34 pm
content: In the thread you say you used an "expensive" 10mF cap but the schematic says 10µF, which one is actually correct?To handle ~60A current pulses, you would need about a dozen low-ESR 2200µF caps - even good quality electrolytic caps can only handle about 2-2.5A RMS ripple. Some can handle 3-5A but you need to go up in size to 3900-5600µF and 35+V, which makes the solution that much more expensive and every bit as bulky.If you had a 10µF cap with power supply leads carrying 60A pulses, it is quite possible the wiring's inductive kick was enough to kill your tantalum cap: if your wiring has 100µH inductance, that's 180mJ of stored energy on top of the 10µF cap's 720µJ... so your tantalum may have been overshooting to something like 190V or whatever voltage it breaks down at so no surprise it died. If you crank the capacitor up to 1000µF, the overshoot should go down to 22.5V.

author: Unknown
author_rank: Unknown
timestamp: September 23, 2014, 07:35:06 pm
content: no no the 10uF cap is on the 7805 the 10mF cap is a different one that's directly on the power input. But yeah, I know this is a very difficult thing to do, especially with the sheer range, as the selected output can vary, the load can vary, so it's not easy to get the parts right. I appreciate all the help guys.Seriously though, there are other boards out there that can do exactly what I want to do and are minute using only small SMD devices and measure 20mm by 40mm. So clearly I have a lot to learn.I need to make sure I have the Physics of this correct in my head. When a cap discharges into a load, it is effectively discharging through a resistor, the ESR, which is going to act like a voltage divider between it and the load. So the lower the resistance of the load, the more current is being dissipated by the ESR. Thus many caps in parallel will reduce the ESR. I need to keep the amount of dissipated power through this ESR to within the tolerance of the cap(s) which can be worked out using its ripple current rating, Using the formula posted earlier I can work out the RMS of the circuit which needs to be below the combined ripple current rating of the cap(s)?So if for instance I have a 12v charged cap with a 2 ohm ESR and a 1 ohm load. The discharge is effectively passing through 3 ohms with 66% of the power dissipated by the cap and 33% dissipated by the load. 12 @ 3 ohms is 4 amps, 66% of 4 amps is 2.6 amps so I'd be looking for a cap with a ripple current rating of about 3 amps? Just as an example. Have I got that right?For my situation I'm going to limit the load resistance to 0.3 ohms, if it detects anything less it won't fire. So that's a maximum pulse of 40 amps @ 12V. It is unlikely that anyone will use more than a 75% duty cycle so RMS = 40 * root(0.75) = roughly 34.5A . If I can find 5A ripple current caps, i'd need 7 of them in parallel with a combined capacitance of about 15mF ? Also bearing in mind electrolytic caps's ESR increases with age, so what other choice of caps do I have here? Also, the device is not in constant use, the load is only fired for 4 to 5 seconds at a time normally, so how much thermal tolerance will there be? I can limit the device through software to only allow so many seconds firing per minute for example.Agh, it's too hard. I'd be better making a variable SMPS circuit instead. Just the SMPS controller chips are beyond me. Isn't there a simple signal generator chip that can be controlled via I²C? Say like I want a 150kHz PWM at 14% duty cycle, then just tell a chip over I²C that's what I want and it outputs it for me? That's all I need.

author: DanielS
author_rank: Frequent Contributor
timestamp: September 23, 2014, 10:35:23 pm
content: The caps I use for switching applications are Panasonic FM-series which have 100kHz ESR in the neighborhood of 0.018 ohms depending on capacity and voltage ratings. Where ripple current is concerned, the highest-rated models in that line only go up to 4A a pop so you would need almost a dozen.For your hypothetical power dissipation between cap and load, power dissipation through a resistor for a given current is P=I2R so if you had 2 ohms ESR in the cap into a 1 ohm load, 80% of your power would be lost in the cap's ESR.Aging-wise, electrolytic caps can last quite a while as long as they are operated well within their tolerances.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 23, 2014, 11:16:32 pm
content: Arg, I should know better:RMS through the supply and the load resistor are as given above...RMS through the capacitor has no DC, so it goes positive (current drawn from cap) and negative (supply recharges cap) alternately.In this case, the RMS of a square wave is Irms = Ipk * sqrt(D*(1-D)).Handy way of looking at this: if D = 0, it's off, and Irms = 0, as one should hope. If D = 1, it's steady on, and Irms = 0. The world is happy. At D = 0.5, current alternates between Ipk/2 and -Ipk/2, so Irms = Ipk/2. For oddball values, it takes that "geometric mean" shape (stuff under the sqrt) with respect to D.Yes, you have the physics right.Film caps are fantastic, but ridiculously huge (large values aren't very available under 250V). How much would you need, anyway?Since you're essentially discharging a capacitor into a resistor, you can take the RC time constant, and figure R*C needs to be way the heck longer than a cycle, to keep ripple down (assuming ESR doesn't already just totally thrash the ripple to begin with). Namely, R is the total R, which includes ESR, switch Rds(on) and the load. If t_cyc = 32us, then R*C should be more like 320us, or even more. 320us / 0.3 ohms (the minimum load resistance, assuming Rds(on) and ESR = 0) is 1000uF already. So, hey, an electrolytic is the right way to go, because, where the hell are you going to find 1000uF worth of films anyway?There is one option, instead of electrolytics, try aluminum polymers. Currently, these fill in the low-voltage range that film capacitors miss -- they're under 100V, moderate values (nothing in the mF+ range, unfortunately), and wonderfully low ESR (typically 10s of mohm even for the small ones). The dissipation factor and energy and power density are all comparable to film capacitors. They're rather pricey though.Another way to estimate capacitance is to start with a ripple figure. This is handy because the fundamental capacitor equation,I = C * dV/dtis calculus, but it's no-thinking-required if you replace dees with deltas, and all your waveforms are straight lines. (We know they're not, because as supply voltage drops, load current drops, and it's a section of an exponential waveform. But dammit, we can still try!)If we assume ripple << Vsupply, then the slope will be fairly constant, and this won't be off by too much (if ripple is some percentage of Vsupply, then the capacitance figure will be at least as accurate). And we can pick something much bigger, just in case.If we take the middle case, dt = 16us, dV = 1.2V (let's say 10% of Vsupply), and I = 20A (remember, half up, half down), then C = 266uF. So again, something very roughly on the order of 100-1000uF. Apparently the earlier case (at RC = 10*t_cyc) will give lower ripple.A few aluminum polymers that size (say 16-25V, a few 100uF or thereabouts), or a few electrolytics much larger (1000uF 25V?), should do well enough in either case. You may actually need many more (or larger) electrolytics, just because of ripple rating.By the way: the capacitors only store energy for on the order of R*C duration, so after a few [tens of] cycles, you're completely dependent on the supply, and if the supply isn't rated for 20A, it's going to brown out as well (first as its capacitors discharge, then as its control circuit responds, then finally, as it goes into current limiting... if it does..). If you want to pulse this thing for seconds at a time (even fractions of a second!), you need MASSIVE capacitors. Ultracapacitors, you might say. But beware that they need to charge up as well, which might not be so nice for your power supply.Tim

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 23, 2014, 11:54:22 pm
content: My thoughts.I would forget about the TVS, and just use a freewheeling shottky diode where D2 is in the schematic, as close as possible to the heater.So just D2 as shottky no D1.Also run two wires from each battery terminal. One thick pair for the high current path only. +ve FET source, drain, load -ve.and one thinner pair for the rest of the 12v, -> 7805 and op amp rails.Separating the 12v should help with any voltage spikes.A small gate resistor too.

author: Unknown
author_rank: Unknown
timestamp: September 24, 2014, 01:22:49 pm
content: Thanks so much guys, you've given me a ton of information that's going to take me while to process but I think you've all given me enough for me to make an informed decision on what to do to make this particular design as stable as I can get it. I think I'm going to have to up the low limit of the resistance of the load, when it starts to get <0.5 ohms the ripple current really begins to get silly so I'm maybe going to limit the load resistance to 1 ohm on this particular design. So again, many thanks for the help and your time in helping me.For the next design, I've been watching some videos and reading about SMPS designs, and I've put together an initial idea of an alternate system so if I can run this by you guys as well, I'd again appreciate any advice or pointing out errors etc.. This is the circuit:Now obviously I've goofed somewhere as this is my first attempt, but the way I see this in my head is: VREF is a voltage supplied by a buffered DAC output from 0 to 5V, so this is used to adjust VOUT by the microcontroller. I felt it was too bulky to show the whole DAC and MCU config so I just show it as a voltage source, but it can be varied from 0 to 5V. This is 1:1 divided down to half and fed into the NII of the comparator with a small amount of hysteresis from R5. The II is fed from a 22:10 divider (8V becomes 2.5V) giving me a VOUT of VREF * 1.6 for a maximum output of 8V.So when VOUT/3.2 is below VREF/2 the comparator will be output high (5V), this will be inverted by the mosfet driver to 0V which switches the mosfet on causing VOUT to rise, when it rises so that VOUT/3.2 is a little higher than VREF/2 the comparator will latch to low (0V), which is then inverted by the driver to 12V which switches the mosfet off causing VOUT to fall, and thus the process repeats. Am I right in thinking this type of arrangement will put less stress on the PSU and components? The output voltage doesn't have to be flat, it is after all only a heating coil it's powering so output riupple is not a problem.Again many thanks for all the help.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 25, 2014, 12:07:41 am
content: Putting VREF or setpoint or whatever on a sky hook is perfectly acceptable. I frequently run simulations with a voltage source component in that place, adjusting or sweeping it as needed. It's handy, and about as representative as anything you might want to drive it with, as long as you make it clear it's an input of course.Anyway, this hysteresis / bang-bang circuit is a fair sight better than switching the resistor directly (assuming the switching frequency is reasonable). It'll be more efficient for a given power output, and easier to filter the supply ripple.But it has some problems, too:- Suppose the diode fails shorted. Will it stop? No, the output voltage collapses, the comparator calls for "MOAR!", and it'll quite happily latch on, until the transistor melts and smoke ensues...- What happens as C3 ages (ESR rises)? The ripple rises proportionally, effectively subtracting more and more of the hysteresis set by R5 into R3 || R4. This forces ripple voltage lower, and switching frequency higher. LMV7219 is a rather peppy little chip, so the switching frequency will ultimately be limited by U3 and Q1 at a few MHz. Needless to say, neither one will be very happy about it.- What happens if the load is a very small resistance, or none at all? If you're sensing VOUT or a shunt resistor (not shown), or something like that, how fast will the surrounding circuit respond? Mind that 1uH will take only 10us to charge up to 120A peak -- and that's assuming it doesn't saturate by then, which would be a large inductor indeed! Any small stray inductance in your circuit won't produce very happy results when that switches off, either. If you're controlling current or power based on an ADC reading that takes not even 10us, but ten times longer still... I think you can see where this is going.The only reasonable way to do it is this: monitor the inductor current, and control that firstly. For this purpose, that's good enough already -- you only need the current or voltage into a load resistor, and that's that. For regular purposes, you use an op-amp to control the current setpoint, regulating the output voltage.There's a few simple ways you can achieve current mode control. Sensing the current flow through a live inductor isn't very fun, but Q1 source is "grounded" (supply is considered ground at AC, so sue me), so it might be a good place to put a shunt resistor. If you put a comparator around that, so that the shunt voltage rises to some point, then fires a trigger to turn off, you're set -- even if the diode fails shorted, the transistor will never be on for more than a few hundred nanoseconds into a short circuit!The tricky part is the logic around it. That 'trigger' stuff doesn't mean wiring the comparator to the gate driver, no, that would oscillate as bad or worse than the hysteresis circuit with C3 absent! What you need is, some event turns the transistor on, then nothing happens until the current comparator turns it off. A latch or flip-flop. Usually, an R-S flip-flop is used, with the 'start' pulse generated by a separate oscillator block (you could do worse than a 555... actually, really you couldn't... it would absolutely work just fine, but, come on...). Pulse meaning, a low duty cycle of course, so the flip-flop doesn't get forced on while the comparator is still screaming 'uncle' (alternately, the F/F should be "reset dominant", so the comparator has the final say).So, in short, you can use a couple transistors wired as a flip-flop, or some logic gates, or even the comparator itself (trying to tweak hysteresis and thresholds and stuff to be useful is generally crude at best, though).You can also use one of many purpose-made chips, like UC3843, which unfortunately contains a ground-referenced comparator (not supply referenced), so it can't be used directly in your circuit. Now, if your load doesn't need to be ground-referenced, you can turn it upside down (use an N-channel MOSFET and so on), and it'll work great.BTW... MC34063 is crap, and has some sort of hysteresis PWM smooshing thing. It's current mode...sort of, but just isn't worth considering. It also doesn't teach proper control methods, so there.Tim

author: Unknown
author_rank: Unknown
timestamp: September 25, 2014, 09:42:25 am
content: Right, I think I'm following you, in short terms I need an oscillator with a relatively short duty cycle and follow this logic?Gate To Be Turned Off when VOUT is greater than VREF+Hysteresis -OR- Current Sense is greater than Current LimitGate to Be On when VOUT is less than VREF-Hysteresis -AND- Oscillator Pulse is High -AND- Current Sense is less than Current LimitThus I need a flip-flop as you described to prevent the gate turning off when the oscillator pulse is low, the oacillator should only be used for the logic of turning it on, not turning it off.Then it's just a question of figuring out the logic for that with the options you described?I also think I know what you mean about the source being grounded, that's how I always picture P devices, I imagine them like an N device but with their view of the world inverted, they see the +ve rail as ground and the -ve rail as a negative supply voltage. Unfortunately, due to the established system in place for these kind of devices, the eventual load is always common to the supply negative (the load is put into the mouth using a metallic mouth piece which is electrically common to -ve due to the power supply also being mains earthed to the -ve to prevent a psu failure from electrocuting someone's face) so using N channels is not impossible, but far more tricky.EDIT:To help me visualize logic, I often try to write them as computer code, obviously this would be impractical without a 100mHz processor and fast ADC, but basically, would the logic be like this:Code:loop(){event=false;if(microSeconds()>nextEvent){nextEvent=microSeconds()+frequency;event=true;}vIn = SenseVIN();vOut = SenseVout();vShunt = SenseShunt();if(vOut>vRequired+Hysteresis || vIn-vShunt>currentLimit)GateOff();elseif(event && vOut<vRequired-Hysteresis)GateOn();}Another problem is I somehow have to detect the load resistance. I currently do this by applying 5V to the load through a 220 ohm resistor and an npn transistor (to prevent the actual vout getting back into the resistance sensing circuit) and then using an opamp to amplify the node between the two. This circuit is switched on and off by the MCU as it doesn't need to be constantly sensing it, only once every 3 seconds or so and then it's only on for a few milliseconds. Now this becomes more complex, the vout has a cap between it and ground, so this approach won't work,Argh, the problems are too big. I have no idea how these other manufacturers manage to produce a board that can do everything I want and make it so small. There's a board out called an SX350, it can output 50W to a load of as low as 0.2 ohms and it measures less than 30mm square. It can sense resistance, it has ground common load, current limiting. Hell, just the size of the shunt resistor alone to handle shunting to a 0.2 ohm load would be crazy, not to mention the amount of power I'd lose through it. *sigh*

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 25, 2014, 12:07:14 pm
content: Have you tried using a design simulator such as LTSpice?It's quite useful, doesn't take long to learn.

author: Unknown
author_rank: Unknown
timestamp: September 25, 2014, 02:20:25 pm
content: I do have it installed, but I find SPICE to be a very frustrating simulator, it's always stopping with errors, especially at high frequencies, convergence and GMIN and what not. I'll give it another shot though.Scroll wheel is back to front for zooming, there doesn't seem to be any obvious way to shift your viewpoint, i can't seem to delete just a part of a wire, it deletes the entire net including all components on it. . There also doesn't appear to be any way to search the component database. Sorry, but I really don't like it. I'm having enormous problems trying to figure out how to invert the comparator output in LTSpice. The gate driver I use is essentially a level shifting not gate,. 0V in=12v out and 5v in=0v out, and in LTSpice I'm lost, i'll have to use another comparator to emulate itEDIT: Sorry no, I really cannot get on with this. I've tried a few simulators and they all have their quirks, but I manage fine with most of them, but this one, it really is dreadful.

author: Unknown
author_rank: Unknown
timestamp: September 25, 2014, 07:56:17 pm
content: How about this one? I've put no current limiting in yet, I'm getting to that (do 1 thing at a time), but I think this method eliminates the need for the oscillator.To start, there will be no voltage at vout (the LOAD) so comparator IC2's output will go to the +ve rail, this will then start to charge C1 through R2 until the voltage across C1 reaches 3V, then comparator IC1's output will go from high to low, turning the mosfet on, this causes vout to rise until it goes over VREF, at which point IC2's output will go low, allowing C1 to rapidly discharge through D1 and bring IC1's output (almost) instantly high again turning the mosfet off. Essentially, C1, R2 and D1 introduce an unavoidable delay between IC2 going high and the mosfet actually turning on, however there is virtually no delay when it needs to be turned off. How viable is this idea?EDIT: I could wire the current limiting comparator through a shunt on the source of Q1, and set it to go LOW output when the current is too high, then wire the output via a diode to C1 causing the cap to discharge if the current gets too high, making the circuit hiccup, as the frequency still cannot go above the charge rate of C1.?I'm a little worried about the frequency. The higher I can get it, the more effective the output stage will be, but if I have my maths correct. To achieve a 100kHz square wave, i'd need 10ns from phase to phase, now, if the duty cycle needs to be quite short, that switch on and off time will be way into the ps range in order to avoid huge ramps and ohmic states in the mosfet. How do I avoid that, there's not many comparators in the ps speed range.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 26, 2014, 12:05:02 am
content: Quote from: Boltar on September 25, 2014, 09:42:25 amIt should be reset dominant, so "if CS > CL, gate off" takes priority. Also, CL should be controlled by an error amp (which can be an op-amp with compensation, or if you must... ADC --> PID register --> DAC). But that's more or less the right idea.They give the logic diagram of course, so if you don't mind reading RTL,http://www.ti.com/lit/ds/symlink/uc3843.pdfQuoteGood, that's exactly what's going on.QuoteI'd be more comfortable with 8kV medical isolation... or better yet, a plastic appliance.Not sure if there's regs specific to oral appliances. Sounds medical-ish though. Yeah, grounded is better than not, but not ideal...QuoteWell, it wouldn't be terrible with a >10MSa ADC and an FPGA. But it's so vanishingly little logic that it's of course pointless (it synthesizes to a single R-S flip-flop, maybe with some AND/OR/NOT stuff to resolve the specific conditions). Implementing it in software would be...grotesque...QuoteNice thing about building a current-mode circuit is: if you tell it to deliver no current, it'll happily just sit there, off...not delivering any current! You can manipulate the current limit or voltage reference signals at will (say, by summing an error signal from a DAC, or analog switches to gate in something else), so you don't need to diddle around with junk like that -- it all stays nice and neat and in the same loop.Given the cap, you will of course want to pulse it for on the order of a millisecond, then leave it off until the next test. The current doesn't need to be much (you may even have trouble adjusting it low enough), but whatever you get is fine, as long as you know what it is, and it's not dangerous or anything (an open circuit load still takes time to charge the cap, and you can probably detect that easily enough with a well-timed ADC sample).QuoteThat sounds quite reasonable. If size were absolutely important, I could probably do better. But there's nothing unreasonable about a PCB that size, assuming you can get the heat out of course. It just seems overwhelming because you have all these jagged, disparate pieces in your mind, still coming together.Tim

author: Unknown
author_rank: Unknown
timestamp: September 26, 2014, 06:21:40 am
content: Tim, if I could afford to I'd send you a bunch of money. You've been super helpful and patient explaining all this to me and you explain things in an entertaining way too. Seriously, thank you for taking the time to go into so much detail. Top geezer. A big thanks to all the others who posted too.