Driving (AC) mosfet switch directly from MPU using GDT - Page 1
Forum section: electronics / projects

author: beduino
author_rank: Regular Contributor
timestamp: October 22, 2019, 08:19:11 pm
content: Hello,I've already written a few lines of codeCode:127 .L6:128 003a C29A sbi 0x18,2129 003c C098 cbi 0x18,0130 003e 00C0 rjmp .131 0040 0000 nop132 0042 C09A sbi 0x18,0133 0044 C298 cbi 0x18,2134 0046 0000 nop135 0048 00C0 rjmp .L6to output on two Attiny85 8MHz MPU pins ~600kHz signals like below, thanks to optimizing _delay_us with taking into account delay in RJMP .L6 those output seams to be very symetrical, while I'd like to use them as inputs via resistors from MPU to small gate drive transformer primary, where GDT secondary turns will be connected directly to mosfet gate.For the moment I've MPU connected to 3.7V Li-ion baterry without any voltage regulator, so we have 3.7Vcc and mosfet gate voltages in the range +/-20V in my case.Do I need eg. zener diodes to protect mosfet gate against spikes above lets say 15V, when we chose GDT turn ratio to something like 1:3.75, so 5 turns on GDT primary vs 19 turns on GDT secondary connected to mosfet gate?Idea behind this GDT is control power of resistive load (80W 230VAC red light bulb) by managing MPU pulses frequency or maybe better pulses width, but at such low amount of turns on GDT primary probably better to keep this frequency high, however it will depend of course on GDT core material used.I had some success of driving this way AC mosfets switches, but in on/off mode where GDT was used as transformer to step up voltage from 5V to 12V clamped by zener diode on mosfet gate with additional rectifier diodes and gate resistor around 100k.Didn't tried this directly without rectifier diodes, so is it possible tomosfet since its gate is itself short circuit with GDT secondary windings?What do you think?

author: Simon
author_rank: Unknown
timestamp: October 22, 2019, 08:43:00 pm
content: I'm not an expert in pulse transformers but the idea of a zener sounds like a good one. It would mostly short circuit any negative outpu or you can put two back to back, or just rectify the pulse and then pun a zener in parallel. You should also put a resistor to discharge the gate quikly enough so that it turns off again particularly if you rectify the pulse.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 22, 2019, 08:57:52 pm
content: 0. Why use an MCU at all? Especially bit-banged, where a CPU crash fries the driver (and probably the switches too)?1. Why bit-bang instead of use the timer-counter?2a. Why does the lamp/switch need to be driven at 600kHz?2b. Or is this more like an isolated switch, why not use PV drivers instead? Do you need bigger transistors than those are suitable for (because of leakage current and switching speed), so are considering a transformer coupled driver? In that case, what kind of circuitry are you proposing to place around the transformer?You didn't provide a schematic so it's hard to give any commentary on things like zener diodes or transformers.Tim

author: beduino
author_rank: Regular Contributor
timestamp: October 22, 2019, 10:09:03 pm
content: Quote from: Simon on October 22, 2019, 08:43:00 pmResistor not needed since as we can see below GDT secondary shorts mosfet gateThose two zener diodes (12V) are really needed here since we have transformer secondary connected directly to mosfet gate, so when MPU do not sens pulses to GDT primary low resistance wire shorts mosfet gate?Another thing is maybe we need also protect MPU pins against GDT primary few turns? We have 2k in series resistance with GDT primary,but didn't tested if this will work.I've already made such circuit with GDT 5 turn primary : 19 turns secondary, but without zenners on mosfest gate

author: beduino
author_rank: Regular Contributor
timestamp: October 22, 2019, 10:20:35 pm
content: Quote from: T3sl4co1l on October 22, 2019, 08:57:52 pmLight bulb power should be adjusted among others based on temperature sensor or simply controled by radio communication etc, so MPU as control logic is a must.Quote from: T3sl4co1l on October 22, 2019, 08:57:52 pmBecause of we have only a few turns on GDT primary, so the higher switching frequency the better I think, since it works like DC-DC converter to step up voltage from VCC to something like 12V mosfet gate low RDSon gate voltage pulses-it will not be visible.Another story is whether mosfets I've used in AC mosfet switch will turn on/off at such switching frequency by using this MPU driven GDT,since so far I've used rectifier diodes in on/off switch, but I'd like to try control power without 100Hz mains blinking, so maybe AC mains will be rectified to 325DC with additional capacitor, so it desn't matter if it will be 10kHz or 600kHz.

author: Yansi
author_rank: Super Contributor
timestamp: October 22, 2019, 10:25:10 pm
content: Ain't going to happen and don't even dare to try.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 22, 2019, 11:27:36 pm
content: You'll be much better off with a phase controller. Instead of a transformer, use an SSR.Tim

author: beduino
author_rank: Regular Contributor
timestamp: October 22, 2019, 11:41:03 pm
content: Quote from: T3sl4co1l on October 22, 2019, 11:27:36 pmI've zero cross detection hardware and MPU software, but I wanted to try do it in a diffrent wayI've AC mosfet switch as shown below based on two IRF840.VGS is rated as +/-20V and 12V zener diode is on this prototype PCB with additional 100k resistor which of course in this experiment we should removeI think 12Vz zener diode should be fine even without second one, because of gate voltage will be clamped to 12V at worst case during GDT pulse or to -1.2V something like this at negative pulse, so no way wethose mosfets with this GDT, but I didn't made any calculations based on IRF840 datasheet how much charge we need to fully turn those two mosfets ON since gate capacitance is in parallel in AC mosfet switch and probably those two 1k resistors on GDT primary which limits input current to ~2mA might be too low, but we can easy limit to 20mA on those two MPU pins and we'll see what happends.No magic smoke so far, so good

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 23, 2019, 03:17:12 am
content: I think you will discover something interesting if you dig into the gate charge.Recall that:- Charge is the time integral of current, i.e., it takes a pulse of current (of some magnitude and length) to charge the gate from/to some voltage. I = dQ/dt.- We can calculate an equivalent gate capacitance by using the gate charge divided by the rated on voltage (Vgs(on), usually 10V). C = Q/V.- If we have an RLC series circuit, we can calculate the impedance and quality factor from Zo = sqrt(L/C) and Q = Zo/R. We typically want Q low for a gate drive circuit. (Note that, for a transformer coupled gate drive, this is the leakage inductance. We can however apply the same reasoning to the magnetizing inductance and the primary side drive circuit, which usually has a coupling capacitor to block DC bias.)- If we have an RLC circuit on the drain, we can also calculate the peak voltage there, and see if it may damage the transistors. We'd have to make some assumption about the inductance of the load (probably not much, as a light?) and the mains supply (ballpark 200uH).- In the event the drain voltage is excessive, what might we do about that? RC damper? TVS diode?- Also, MCU pins are standard LVCMOS, i.e. about 30 ohms output resistance.Tim

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2019, 03:49:41 am
content: Quote from: beduino on October 22, 2019, 10:09:03 pmAlmost... Try this:This will ensure that always 1 mosfet on each side are always on at the same time during the 600Khz square wave.Note that you should run this at 10-20Khz square wave too as the gate capacitance of the mosfets and weak IO output drive of the MCU wont cope good with 600Khz square wave.Only use this circuit for resistive loads like incandescent light bulbs. Anything else might go haywire like inductive loads which may send huge voltage spikes and currents above the mosfets capabilities while switching.

author: Simon
author_rank: Unknown
timestamp: October 23, 2019, 06:46:10 am
content: Oh, all you wanted to do was dim a light? so just use a conventional dimmer setup. For 50Hz an opto coupler can give you any isolation desired.

author: beduino
author_rank: Regular Contributor
timestamp: October 23, 2019, 07:17:56 am
content: Quote from: Simon on October 23, 2019, 06:46:10 amNope, I want control power of this light bulb using GDT (gate driver transformer) directly from MPU and additionally eliminate 50Hz flickering.However, according do IRF840 datasheet its gate capacitance 832pF in prallel double of that, realized now now chance to get 600kHz switching speeds at such limited MPU GDT primary current ~2mA.I've also no specs of random E core used for testing, so it require more sophisticated calculations and more tests.

author: Yansi
author_rank: Super Contributor
timestamp: October 23, 2019, 09:53:51 am
content: Jeeeez... And how do you eliminate that flicker with this, as the bulb still operates at AC?

author: Simon
author_rank: Unknown
timestamp: October 23, 2019, 10:36:11 am
content: If it's incandescent the time constant for the filament cooling is longer than the 100 Hz pulse period. You may get some flicker at very low brightness. I found i had to run LED's at a few hundred Hz to get rid of flicker. You don't need 100's of kHz, even 1 kHz is ample which again is well within the limits of an opto and other more expensive isolators exist if you can power both sides.If you are paranoid about flicker why not rectify the supply and use a very small smoothing capacitor to not ruin power factor and then just use 1 MOSFET in a classic setup?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 23, 2019, 11:05:25 am
content: Brian: would be easier to just FWB rectify the gate signal.There's no 50Hz flicker, it's 100Hz, and you can't get rid of that without energy storage. You could make a VFD where AC comes in, gets rectified to DC, then is output as either infrequently changing DC (i.e., swapping polarities to reduce sputtering of the filament; low frequency AC, full duty cycle square wave), or high frequency AC (a few kHz will not be visible to the eye under any condition). The DC supply could be varied (with a buck converter, or since efficiency really doesn't matter here given the incandescent light and apparently thermal application, a linear regulator), varying output. In the higher frequency AC case, duty cycle could also be varied.I once did this for strings of LEDs:https://www.seventransistorlabs.com/tmoranwms/Elec_LEDs.gifTim

author: beduino
author_rank: Regular Contributor
timestamp: October 23, 2019, 06:53:34 pm
content: Quote from: T3sl4co1l on October 23, 2019, 11:05:25 amYep, of course it is 100Hz flicker - I've light sensor to test quality of the light around meAnyway, flickering is not a problem, because of we could rectify mains and use step down converter with inductor and yep AC mosfet switch instead of single mosfet, so (AC) marked this way, because of I want drive those mosfets using GDT.I think, it is time to make some real experiments with 100k resistor removed in my AC mosfet switch shown a few posts above

author: beduino
author_rank: Regular Contributor
timestamp: October 23, 2019, 09:22:45 pm
content: Quote from: T3sl4co1l on October 23, 2019, 03:17:12 amYep, probably now it is time to look closer into this, since I've quite nice shiny leds in antiparallel configuration with 1k resistor on my GDT secondaryGDT is quite "bulky" but it does the job and @ 600kHz with 4Vcc Attiny85 MPU 8MHz current on GDT primary is now limited for pin safety by two 100 Ohm resistorsAs we can see test LEDs are powered directly from MPU with galvanic insulation by GDTPlenty of charge to turn on/off AC mosfet switch, but now question is what switching frequency of this AC mosfet switch based on two IRF840 we can get?Since, I do not know turns ratio in GDT (randomly chosen from old project) lets rectify its secondary and see maximum voltage we can charge capacitor to have some idea what turns ratio could be?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 23, 2019, 10:06:17 pm
content: Quote from: beduino on October 23, 2019, 09:22:45 pmCitation needed.QuoteAnd how low can the transformer go, say if in some strange reality it can't supply enough charge after all?Say, did you have a go with any of those equations? Like, C = Qg / Vgs(on) and t = RC? How does t compare to 1/(600kHz)?QuoteMind that, if the secondary waveform exhibits ringing, you'll be measuring that, in addition to the turns ratio.I suspect with ~280 ohms in series with the primary, it's going to be underdamped so this won't be an issue after all, but with that windup, you may have the opposite problem that you're running out of bandwidth, i.e., the output will be very soft and very not square at all.Tim

author: beduino
author_rank: Regular Contributor
timestamp: October 23, 2019, 10:38:49 pm
content: Quote from: T3sl4co1l on October 23, 2019, 10:06:17 pmIRF840 datasheet says Ciss=832pF Input Capacitance @ VDS25V f =1MHz VGS=0 , 1664pF capacitance for two mosfets in AC switch.It should be at least +/-10Vmax/min on GDT secondary according to quick test I've made right now,so we have something likeQ: 1.664e-8However, there is no current limiting resistor on GDT secondary, only turns of copper wire, so its resistance should be quite low - cheap YATO multimeter says: R: 1.3 OhmThis gives: t: R*C: 2.1632e-9

author: beduino
author_rank: Regular Contributor
timestamp: October 23, 2019, 10:54:56 pm
content: Now calulated something like average current needed to provide charge for 10Vgs of those IRF840 @ 600kHz and it looks liek this if I do not missed something-I've assumed half of the time charging, second half discharging gate by GDT secondary:Code:(%i11) F: 600000.0;(%o11) 600000.0(%i12) T: 1.0/F;(%o12) 1.666666666666667e-6(%i13) T2: T/2;(%o13) 8.333333333333334e-7(%i14) t: R*C;(%o14) 2.1632e-9(%i15) T2/t;(%o15) 385.2317554240631(%i16) Q/T2;(%o16) 0.019968Looks like something about ~20mA average current.Probably by lowering down this switching frequency a few times will help get enougth current for full open/close AC mosfet switch?

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2019, 11:18:37 pm
content: Quote from: T3sl4co1l on October 23, 2019, 11:05:25 amWhat I think the OP is trying to do,and not clearly explaining to us all, without a power transformer, drive a 12v lamp from 240v mains, pwm-ing the middle of the source sine wave so that it appears to look on average like 12v AC square wave 'power wise' to the filament. If the op sticks with the 120v lamp, he can remove the flicker only if he wants the lamp to operate around 10% brightness...This means the bulb will still shine full brightness since when the source AC waveform is between that tiny period where it's within +/-12v, the mosfet is full on. While the AC waveform is larger than +/-12v, the MCU chops up that power making it on average to appear to be a regulated + or - 12v over time.With such a short off time, the bulb will appear to be truly DC powered. This project will also have the advantage of maintaining a true high power factor.The op needs the high speed on-off mosfet drive to really make tiny pulses during the almost 300v peaks. He will also need a soft power-up cycle as a 12v halogen bulb drives massive current when the filament is cold.The 4x mosfet circuit I posted protects the one side off mosfet since a transformer drive cant keep both mosfets on at one time unless the OP want to loose half of his power.If they were fast enough, (I know they are for 1-2Khz, they turn off slow, it's been awhile since I used them.) I would recommend using 2 photovoltaic optocouplers to drive the mosfet gates instead of a gate transformer. Also, 2-4ma from the MCU will run the photovoltaic fine.As for our eyes, filament flicker isn't too bad, as well as for many cameras, but when used for high quality photographing/filming or special sensitive situations, this project will make the bulbs effectively appear DC powered.The final cheapest solution means a bridge rectifier and 1 mosfet and the MCU driving the gate of 1 mosfet, though, the OP will be touching the mains with his MCU directly and I think that what's her trying to avoid.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 24, 2019, 01:44:42 am
content: Quote from: beduino on October 23, 2019, 10:38:49 pmI pulled out Qg specifically, because Ciss underestimates it by typically about a factor of 4.Which... hm, you've already got to be careful here, because there's the original, created by International Rectifier:https://www.datasheets360.com/pdf/-653557743118012551which says 63nC max Qg and 1300pF typ Ciss. The Fairchild (dated 2002) and the Vishay/Siliconix (2016) datasheets have very similar spec. The ST (2002) version however shows significant improvement with 39nC max Qg and 832pF typ Ciss:http://www.alphacron.de/download/hardware/IRF840.pdfSo it matters which one you're buying. Not all manufacturers make exact copies of a multi-sourced part!(FWIW, Vishay is the current owner of the original IR product line, including this part.)If we use the average capacitance calculation, we get Ceff = (63nC) / (10V) = 6.3nF. Note this is max, so it's not directly comparable to typ Ciss. The Fairchild datasheet gives 42nC typ., or 4.2nF equivalent, 3.5 times the small-signal Ciss figure.What's going on?The gate capacitance charges as normal, and is in fact around 1.2nF, and doesn't vary much with voltage by itself. The stinker is the G-D capacitance, which because the drain voltage has a huge swing (up to 500V), this capacitance is hugely amplified (Miller effect). The only reasonable resolution is to look at the charge required to move the gate from 0 to 10V, and divide by that voltage swing to turn it into an average capacitance.That's the justification for the Qg calculation.So if the gate looks like 4.2nF (or up to 6.3nF), and it needs to charge in a tiny fraction of 600kHz (1.6us), what resistance is required?If we say 1/20th of a cycle maximum, or 80ns, in two time constants (t = 2RC), we need a resistance of about 10Ω maximum.We likewise need to deliver a peak current of (10V) / (10Ω) = 1A, preferably even more to drive it faster. Per transistor, so two in parallel also.With a ~2:1 current ratio on your drive transformer, that's a demand of over four amperes from the poor ATtiny!But it cannot deliver anywhere near that current, because the primary circuit has about 280 total ohms. It can deliver about 14mA short circuit.What could we achieve, then?This in turn suggests that Fsw should be about as many times slower as the gate drive is. So, if we can't do 4A but we can do 14mA, we should run at a frequency 4/(0.014) times lower, or about 21kHz. And again, lower would be preferable, to save on switching losses.Or we can add a gate driver IC, but we need to power it at some point. If it's wired directly to the transistors, it needs an isolated supply of 9 to 15V.QuoteYikes! Realize what kind of an assumption this is -- if the secondary had a source resistance of 1.3Ω period, then it must be that, no matter what resistance the primary circuit has, you can draw many times more power from the secondary. You've made a huge power amplifier! That's a very fishy conclusion, so the premise probably was in error.The equivalent circuit for a transformer may look odd. It's a chunk of wire, right? Well, that chunk of wire is supposed to look like a large AC impedance (that's what the turns around the core does). So it doesn't factor into our circuit. Rather, the primary and secondary sides are connected by the ratio. This looks more obvious if we draw it with no transformer at all -- but to do that, we have to scale all the values from one side, by the ratio, so that they are equivalent to what's on the other side.Say we scale up the primary side. Assuming 1:2 turns ratio, the primary voltage shows up on the secondary side as double, and the primary current shows up as half. 2 * 1/2 = 1, because energy is conserved of course. This means that the primary resistances appear to go up by a factor of 2*2 or 4. So the MCU and two 100Ω resistors looks like 8V logic (instead of 4V), with ~160Ω equivalent pin resistances, and 400Ω series resistors. A total of almost 1kΩ!This is why the gate drive will be, needless to say, a bit disappointing.*Technically, any nonideal transformer can be replaced by an ideal transformer (if needed for 1:1 isolation) and three inductors,if you don't mind that one of them may be negative.Obviously, negative inductances are hard to come by, and this is just an equivalent circuit. But it's nice to know that equivalent circuits don't stop working just because a number comes out unrealistically.Quote from: beduino on October 23, 2019, 10:54:56 pmI'm not sure what numbers you used here. Qg(tot) * Fsw does equal supply current for a gate driver IC. The peak current is circa T2/t times higher though.Tim

author: beduino
author_rank: Regular Contributor
timestamp: October 24, 2019, 06:39:33 pm
content: Quote from: T3sl4co1l on October 24, 2019, 01:44:42 amLooks like your calculations are right for 600kHz, since I've just tried to connect to GDT secondary with only one zener 12V on AC mosfet switch gates and no resistance drop - cheap YATO multimeter says infinity resistance on all ranges, while when connected this AC mosfet switch gate to 4VDC we have ~3.8 Ohm resistance on mosfets drains, so ~1.9 Ohm per each IRF840 in series, so AC mosfet switch itself is fine after GDT testSo, for the moment this is the only good news - we have working AC mosfet switch with DC Vgs

author: beduino
author_rank: Regular Contributor
timestamp: October 24, 2019, 07:00:47 pm
content: Quote from: BrianHG on October 23, 2019, 11:18:37 pmI've infared light bulb 230VAC 80W-100W like shown below, and it is used in winter days to warm up my custom made sleeping capsule where warm air is prowided in aluminium pipes, so temperature controll needed and light flickering even at 100Hz can disturb my dreams, not mention that I'd like to experiment with different freqencies to study how it affect sleeping quality or maybe it also affects water molecules in air, so that is why I might be interested in high frequency switching, but now I'm shocked it doesn't work with pure MPU pins output @ 600kHz switching frequency, so maybe external transistors needed in totem pole configuration I've already used in other project to be able use lower resistors on GDT primary

author: Simon
author_rank: Unknown
timestamp: October 24, 2019, 07:35:38 pm
content: light flickering at 100Hz disturbs your dreams? the light does not flicker.

author: beduino
author_rank: Regular Contributor
timestamp: October 24, 2019, 08:08:25 pm
content: Quote from: T3sl4co1l on October 24, 2019, 01:44:42 amNow changed software and I've nice ~20kHz input to GDT, however bloody cheap YATO multimeter maybe is not capable notice those short pulses ?I think I'll try connect this AC mosfet switch do Saleae Logic analyzer with 470 Ohm pull up resistor and try to catch turn on/off

author: Simon
author_rank: Unknown
timestamp: October 24, 2019, 08:10:02 pm
content: a cheap meter will do 1kHz at best.

author: beduino
author_rank: Regular Contributor
timestamp: October 24, 2019, 08:16:27 pm
content: Quote from: Simon on October 24, 2019, 07:35:38 pmWho knows how our brain works and what it does during sleep?Even with eyes closed probably everyone is capable notice longer light pulses, but maybe we simply do not notice higher frequencies, but it might somehow affect neurons activity

author: beduino
author_rank: Regular Contributor
timestamp: October 24, 2019, 09:32:09 pm
content: Quote from: Simon on October 22, 2019, 08:43:00 pmIt is strange, but when I've disconncted zener diode (I belive in) connected to AC mosfet switch gate (I had only one zener so far and it worked with 4VDC Vgs ) now it works fine with 1k load @ 4VccEven with 100k resistor on mosfets gate we have nice ~20kHz output on AC mosfet switch, but this is not supprise, since we have a few mA gate current for sure.It is strange why this zener diode, which I'll remove from this PCB to examine, makes GDT not working at all as gate driver?Maybe we need two as suggested in antiparallel, to provide the same GDT secondary load in full period?Anyway, now we drive AC mosfet switch directly from MPU using GDT, however it will be interesting to see what happends with this 80W 230VAC infrared light bulb, since at 4Vcc and 1k load resitor we had 2V on AC mosfet drains shown by this YATO multimeter, so probbaly it was fine, but this blood zener diode tried ruin my night todayAny ideas, why this zener diode sucks in this AC mosfet switch when we use GDT as gate driver @ eg. 20kHz?

author: Simon
author_rank: Unknown
timestamp: October 25, 2019, 07:19:43 am
content: Quote from: beduino on October 24, 2019, 08:16:27 pmSo your eyes can see the 100Hz but when you chop the still remaining 100Hz up at a higher frequency it sudenly dissaperes? I already explained, this is a fillament bulb. the time it take the filament to cool down and stop glowing is longor than 1 cycle at 100Hz. It is a pysical low pass filter.As I already said this is all a waste of time. just rectify the mains and if you are hell bent on getting rid of the non existent flicker you are chasing around then you must use a smothing capacitor. Then chop the DC with whatever frequency you like. 1kHz is ample. more than that is plain stupid! Put an inductor in series with your bridge rectifier to try and do something towards restoring power factor.Also remember that you plan to sleep in this thing. Given you obvious lack of experience I would suggest being extremely cautious about falling asleep with your contraption running. Unless you were having plans for an early death and automatic cremation.

author: beduino
author_rank: Regular Contributor
timestamp: October 25, 2019, 07:00:22 pm
content: Quote from: T3sl4co1l on October 24, 2019, 01:44:42 amThank you very much for so detailed calculations, which I've already tested previous night sleeping in capsule with heat coming from 80W 230VAC driven by gate transformer in a way where I use software pseudo-random generator with additional xor of AVR time counter for even better randomness to create gate drive pulses with avg ~20kHz frequency in average in a range something like 10kHz-30kHzSo, It looks like those IRF840 mosfets in AC switch opens (turn on) very well at predicted switching frequency in this case, since after a few hours test during the night, no any significant temperature rise on mosfets- maybe slightly warm.BTW: I have no idea why peak current might be circa T2/t times higher - I'll study also another manuals howto estimate this current needed to drive mosfets at given frequencies, but for the moment it looks like logic analyzer output from AC mosfet test and real experiments with ~100W 230VAC light bulb shows that your calculations were really helpfull to make this thing working as expectedWARNING: Off course I didn't touched those mosfets on 230VAC circuit side by hand while connected to mains power grid contact !!! I never do this even of datasheets claims sometimes some triacks and other stuff heatsink tap is insulated !!!

author: beduino
author_rank: Regular Contributor
timestamp: October 25, 2019, 07:09:13 pm
content: Quote from: Simon on October 25, 2019, 07:19:43 amNope, it works as expected now, thanks to very helpfull detailed analysis of gate current requirements at given frequency made by T3sl4co1lI will try debunk this flickering free at 100Hz pure mains claims, while powering infrared light bulb later - I need setup this experiment with phototransistor

author: beduino
author_rank: Regular Contributor
timestamp: October 25, 2019, 08:19:03 pm
content: Quote from: Simon on October 25, 2019, 07:19:43 amNope, this thing I mean sleep capsule covers bed, but 230VAC 80W-100W is outside at least 0.5m and infrared light comes inside by using aluminium 110mm pipe which reflects light inside, so 230VAC light bulb is outside sleeping place and is not more danger than table night lamp not far away from bedAC mosfet switch with control electronics is a few meters away in another room right now.I've made photo right now how this infrared light pump looks like in the dark, but it might be patent pending, so sorry no image in daylightNow, since we have AC mosfet switch working @ 20kHz +/-10kHz and powered light bulb from mains 230VAC 50Hz for the moment It could be interesing to see if there are any disturbances in output infrared light other than 100Hz coming from mains AC power, since I've implemented random switching frequency of AC mosfest switch and sample waveform below - already posted above earlier:

author: Simon
author_rank: Unknown
timestamp: October 26, 2019, 06:16:35 pm
content: oh now it's a random frequency that is above the frequency that is already above the low pass frequency of the bulbI'm sure your patent will be wonderful.

author: beduino
author_rank: Regular Contributor
timestamp: October 26, 2019, 06:32:31 pm
content: Quote from: Simon on October 25, 2019, 07:19:43 amThis thing below was running previous night for about 8 hours sleep and I can confirm amazing dreams comesPatent for good sleepAnyway, what do you think about the way I disipate heat in this AC mosfets switch from mosfets drain taps directly to wires using 3mm hole connectors in a way shown above.It is at least 0.5mm2 copper wire and at least 2m long from this pcb to mains contact and more than 3m to infrared light bulb ~100W?This means, that at 230VAC mains 50Hz we have I~0.434A with IRF840 max RDSON R~1, but ~@ 20kHz PWM we have 50% on/off so, it looks like we can expect power loses something like: 2*(I^2*R)*50% ~0.2W total while two mosfets in series, but only ~0.1W per mosfet?After this 8 hours test today those mosfets were maybe only slightly warmer than room teperature, so do we need any heatsinks, while it looks like in this case, copper wires via those soldered 3mm connectors mounted directly under mosfet drain taps shouldn't quite well disipate any heat into >0.5mm2 copper wires >5m long on both sides of this AC mosfet switch?

author: Simon
author_rank: Unknown
timestamp: October 26, 2019, 07:46:42 pm
content: heat won't magically race up the wire. The first short length may help but after the first few 10's of mm it's not helping anymore.I refer to my comment you quoted in your post: you don't know what you are doing. most of your loses are not resistive while the mosfet is on but during the switching that happens at twice your drive frequency. The MOSFET does not instantly go from full on to yull off or viceversa. The transition will be "resistive" and will dissipate more heat than your 50% on. As I said 1kHz is ample for what you are doing but you know everything so why bother telling you. So long as no one else dies when you burn your house down I am happy to let Darwins law take it's course.

author: beduino
author_rank: Regular Contributor
timestamp: October 26, 2019, 08:29:21 pm
content: Quote from: Simon on October 26, 2019, 07:46:42 pmEven when it will be 100% not 50% given only to estimate this is still less than 1/4W per each mosfet in TO220 package connected to copper wires directly from drain tap, so etimated amount of additional copper in wires is ~0.018kg which means it is huge heatsink, while this thing will usualy work in room temperature below 25*CExperiments shows that this AC mosfet switch doesn't need any additional heat sink in this case where we have huge amount of copper in wires connected directly to mosfet taps - this is beauty of custom design, where thanks to taking into account other things than only to be competitive with low cost on the market and look for as many customers as we can, which means another constrains to lower down price including shipping, while this design do not need to hit so huge market and thanks to using mains wires in a smart way as a heat sink, it can easy fit requirements of custom design.Probbaly you believe in too much in market electronics products, which sometimes fit into some government regulations, but sometimes you can find CE mark on things not safe at all, so sometimes it is better to know what is inside and how it works, because of it can save your ass and money when fails - easy to repair

author: beduino
author_rank: Regular Contributor
timestamp: October 26, 2019, 08:35:09 pm
content: Quote from: Simon on October 26, 2019, 07:46:42 pmNo magic thereMosfets in "bulky" TO220 package connected directly via 3mm holes tap drain to soldered copper wires >0.5mm2 lets assume 4m long we have more than 0.0178kg of copper so less than 1/4W will flow througth 2m long copper wires in room 25*C temperatures... Noneitherneeded to imagine that heat will disapear and heat will be transfered to room air

author: Simon
author_rank: Unknown
timestamp: October 26, 2019, 09:04:46 pm
content: Quote from: beduino on October 26, 2019, 08:35:09 pmI REPEAT, YOU DON'T HAVE A CLUE WHAT YOU ARE TALKING ABOUT! YOU ARE TALKING BOLLOCKS WHILST PLAYING WITH THE MAINS. THAT IS A RECEIPE FOR BAD THINGS. THIS THREAD IS A WASTE OF TIME BECAUSE YOU WON'T LISTEN. PLEASE MAKE SURE THAT NO ONE ELSE IS INVOLVED WITH YOUR EXPERIMENTS BECAUSE THE ONLY PERSON YOU SHOULD END UP KILLING IS YOURSELF.Yes of course your rihgt, copper offers no resistance to heat and all of that plastic insulation is as conductive to heat as copper. You carry on with your delusions and don't listen to anyone! Or are you trolling us?

author: beduino
author_rank: Regular Contributor
timestamp: October 26, 2019, 11:11:44 pm
content: Quote from: Simon on October 26, 2019, 09:04:46 pmPlastic insulation doesn't have to be as conductive to heat as copper, since quick estimation of area around 4m long 0.5mm2 copper wire is A: 0.010 [m^2] which is equivalent to 10cm x 10cm sheet of thin insulation, so now imagine what can happen when we heat this quite big area with lets say 0.5W from one side having 25*C room air on other side?Problem is you didn't provide any calculations to proove your claimsI listen to people like T3sl4co1l , who provided very usefull estimation of gate current needed, so big letters with warning not needed in your posts.BTW: I usemaximasoftware under Linux instead of Window$ calculator, so probably that is why no smoke so far in many projectsAttached detailed calculation of estimation area around a few meter copper wire. Show us your calculations to proove your claims

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 27, 2019, 01:56:41 am
content: The heat spreading length for wire of that size is about an order of magnitude lower than you imagine. The wires contribute negligible dissipation area. The transistor assembly is dominant, and can dissipate a couple watts in free air.Evidently you aren't dissipating much power, so it doesn't matter much.QuoteAs the saying goes, it is a poor craftsman who blames his tools, or who trusts them blindly.Tim

author: Simon
author_rank: Unknown
timestamp: October 27, 2019, 07:38:37 am
content: Quote from: beduino on October 26, 2019, 11:11:44 pmOh you want me to do your job for you? personally I am thinking if you die in a fire that involves you alone now that will be better as at the rate you are going clearly at some point you will do something really stupid and injure or kill other people!QuoteI too deeply value Tim's contrimutions when he answers because he is very knowledgeable but you are expecting other people to do your design for you or at least come up with complete and utter proof as to why you are wrong. But I won't bother. If you kill yourself by being stupid and not taking the hint so be it.QuoteSo you admit being a troll, good, good, I will feel less bad when i ban you.QuoteAnd what have you proved? that you can calculate geometry, well done you. Do you know what thermal resistance is? If the thermal resistance in 10mm of wire is already too high to let the heat flow to the rest of the wire all of that wire was wasted. I was astounded when I discovered what a "poor" conductor an aluminium heasink was and that putting a power resistor at one end did not really heat up the other end. If you are intelligent you would understand what I am saying.i could of course set up a test with my thermal imaging camera and show you but why should i waste my time helping you? You will just ignore anything i say that does not resonate with you. So you go ahead and do as you please. i just hope you don't injur anyone else. This project may not hurt you but with your attitude clearly in the future you are likely to do something really stupid and possibly hurt other people.

author: beduino
author_rank: Regular Contributor
timestamp: October 27, 2019, 07:56:21 am
content: Quote from: Simon on October 27, 2019, 07:38:37 amSo do something to proove your claimsI've working circuit in reality not simulator and it performs as expected

author: Simon
author_rank: Unknown
timestamp: October 27, 2019, 08:00:33 am
content: I never said you circuit would not work. I was trying to explain to you that you are not using the wire as a heatsink, not that much anyway. Obviously there is so little heat that your setup works but you have no idea about what is happening, it's pure luck. This one may not kill you, the next could.I'm done here.

author: beduino
author_rank: Regular Contributor
timestamp: October 27, 2019, 11:02:51 pm
content: Quote from: Simon on October 27, 2019, 08:00:33 amThere is no luck, when you turn on/off mosfet using GDTEverything depends on application - in this case it doesn't matter when something goes wrong and for example mosfet will be shorted and conduct 100% instead of in a controled way, because of it works as a smart switch, but even when we provide full light bulb power not such a big deal - slightly uncomfortable temperature rise inside sleeping capsule, but it can be easy detected and for example fan forced to higher RPM or turn on alarm.Yes, I've in my sleeping room alarm clock, but instead of clock it has light sensor, so it will be integrated with sleeping capsule in a way, that you wake up when it is daylight outside-no need to set alarm clock time anymore

author: beduino
author_rank: Regular Contributor
timestamp: October 28, 2019, 06:55:06 pm
content: Quote from: T3sl4co1l on October 27, 2019, 01:56:41 amMosfet assembly, since mounted ~0.5mm above PCB while drain tap sits on wire connector (3mm inside hole and more than 7mm outer ring) also helps dissipate heat with additional copper layer on opposite side.However, it is clear when you soldering connectors with copper wire inside a lot of heat is transfered into wire since you have to be carefull to keep connector during soldering in a position to avoid solder flow into the wire.In this case, where we have not to much heat to dissipate this heat transfer into wire can be not significant.I think the only way to debunk theory that those wires with connectors on mosfet drains can not be used as heatsinks is to use thermal cameraAnyway, estimated amount of copper in wires connected to those two mosfet drains in my AC mosfet switch is around 10g copper in wire per each side which is significant thermal mas in comparision to TO220 package taps coper volume, so I'm confident without any doubts that it must be significant heat transfer into those wiresSome IRF840 sellers says it weight 1.5g total vs ~10g copper in wires not included connectors.It is a pity Simon didn't made experiment using thermal camera if he thinks I'm wrong.Maybe it could be interesting topic for Dave fundamentals fridays everybody likes?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 29, 2019, 01:22:37 am
content: Thermal cam just shows heat distribution. Doesn't show heat flows. Soldering wires requires a lot of thermal mass, but not nearly so much steady-state heat (not that you'd ever be cooking a soldering joint for minutes at a time, anyway!).I could equally well turn around your argument by asking how far down the wire you have to hold it, when soldering -- does the heat conduct along the whole length, or just a dm or two?Which, again, because of thermal mass, is a similarly flawed argument; the heat will indeed conduct further down in the steady state. But not by much.In any case, if a thermal cam is used, we can at least estimate the heat dissipation by measuring the surface area of the item in question, assuming an emissivity (mostly irrelevant to heat dissipation at low temperatures, but obviously quite important to the camera) and convectivity (heat dissipation into the air, the dominant sink), and combining everything to get a total power figure. Hopefully this meshes with the actual electrical power dissipation...Tim

author: beduino
author_rank: Regular Contributor
timestamp: October 29, 2019, 04:00:48 pm
content: Quote from: T3sl4co1l on October 29, 2019, 01:22:37 amSoldering 3mm connectors takes a few seconds while clamped over copper wire, so heat conduction along the whole length of a few meters link is not possible at such high speed, but ac mosfet switch in my case creates heat for hours continuously which means the closer the mosfet drains taps, wire temperature will be higher, than at some point depending on disipated heat power closer to room temperature and heat disipated into free air.Additionally, as I've already read in other posts, those a few meter long wires on each side of ac mosfet switch connected directly to mosfet taps probbaly should help (thanks to its inductance) limit (di/dt)

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 29, 2019, 06:18:09 pm
content: Heh... heh heh...A few meters won't limit mains dI/dt in any meaningful way, but mains itself is usually modeled as ballpark 100uH, including the inductance of all the wiring up to the pole/pad transformer (and a bit behind that as well, but because medium voltage distribution is done at a pretty modest impedance, it doesn't account for much inductance; the local wiring dominates).But that same limit in dI/dt is also what blows up your transistors. It stores energy at turn-on, and has nowhere to go at turn-off.In short, if you had enough switching speed or inductance to matter, you'd know it very quickly.Tim