Problem with DIY dimmer - Page 1
Forum section: electronics / projects

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 07:06:17 am
content: I have built the dimmer shown in the attached file.(the parts are the ones shown in the drawing)It works fine with incandescent bulb and works fine with a Tecsol soldering iron I had.(here let me note that I want it for this job, to regulate the temperature of the soldering iron)I burned the Tecsol and I got aZD-70D Double Power Tweezers 20Watt / 130Watt...Well, with this soldering iron the dimmer does not work !!!Its temperature is constantly at the maximum no matter the position of the potentiometer !!Why is this happening?I tried again with the incadescent lamp and then with a motor: the dimmer with these works fine!Only with this particular soldering iron I get this strange bahavior!

author: james_s
author_rank: Super Contributor
timestamp: August 19, 2018, 07:30:31 am
content: This iron probably has an internal controller. It may also have a transformer, basic dimmers don't like inductive loads.

author: Ian.M
author_rank: Super Contributor
timestamp: August 19, 2018, 08:12:42 am
content: The iron probably has a similar phase control circuit in it for its dual power feature. As its normal operating power of 20W requires a TRIAC fired at a phase angle of 123 degrees, most or all of the range of your phase control circuit is ineffective.

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 08:24:02 am
content: Guys, sorry to dissapoint you...but no internal controller, no transformer, no phase control circuit, no star wars tech.Take a look at the attached photos (I just opened it up).A f$$#ing diode in a switch!!When the switch is pressed the diode is shorted, so you have the whole sinewave accross the resistor...(and, according to the manufacturer, goes from 20W to 120W...)

author: Ian.M
author_rank: Super Contributor
timestamp: August 19, 2018, 08:40:54 am
content: Well, that's unexpected. The diode can only reduce the power by 50% in any full cycle. The only way it could work as specified is if they used a PTC heating element, which could draw 120W when cold, but its resistance goes up enough when hot for it to drop to 20W at 50% duty cycle. In that case, when you reduce power, the element cools and it draws more current till it reaches equilibrium, only slightly cooler.To be certain what's going on,you'll need to measure the current it takes, preferably using an isolated current probe on a scope. Alternatively, first measure the element resistance when cold (across mains plug L and N pins with the button held down), run the iron till its at max temperature, unplug it and immediately start measuring its element resistance (across mains plug L and N pins with the button held down), repeating the measurement every ten seconds as it cools till the solder on the bit solidifies.The diode may be causing issues for your control circuit - You could try putting a 40W incandescent bulb in parallel with the iron so the TRIAC's load isn't Hi-Z on one half cycle, to see if that lets you get a usable control range.

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 08:52:20 am
content: I 'll just replace the diode and the switch with a wire (or short the switch).But because it must not work at 'full speed' for more than 20 seconds (according to the manufacturer) I 'll always use it in conjuction with my dimmer.

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 01:02:15 pm
content: What about this:1. replace the diode in the soldering iron with a wire2. put the diode 'before' the dimmer (so the circuit is: mains->diode->dimmer-soldering iron)Should this work?

author: Ian.M
author_rank: Super Contributor
timestamp: August 19, 2018, 01:13:30 pm
content: Not any better - it doesn't matter what order the dimmer TRIAC, element and switch¦¦diode are, as they are all in a series circuit.The only good option is to permanently attach its cord to the dimmer. You can either short out the handle switch and put a 'boost' switch on the dimmer, or rewire with a four wire cord and use the extra wire to make the handle switch the 'boost' switch (which bypasses the dimmer pot so it goes to full power when pressed). In series with the dimmer pot, put a preset so you can set max normal power to a bit more than 50% - 60% should be OK.However at the end of the day, its still an unregulated firestick, and you'd have been better off getting a dirt cheap Hakko clone, then saving up to replace the bit and element with genuine parts.

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 02:22:52 pm
content: I don't understand why the diode makes it work in 'full mode' no matter the pot 's position.Can someone explain this?

author: Andy Watson
author_rank: Super Contributor
timestamp: August 19, 2018, 02:29:27 pm
content: It's clearly not a diode. A diode would simply halve the power. Are there any markings on it? Can you provide a close-up, in focus picture of it?

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 02:45:43 pm
content: It clearly is a diode, 1N4007.

author: Andy Watson
author_rank: Super Contributor
timestamp: August 19, 2018, 03:00:02 pm
content: There must be some nefarious activity elsewhere thenThe DC component will alter the response of your phase controller, but that does not explain why it goes to full.ed: negation added, oops !

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 03:06:25 pm
content: Quote from: Andy Watson on August 19, 2018, 03:00:02 pmDoes or doesnot?

author: schmitt trigger
author_rank: Super Contributor
timestamp: August 19, 2018, 03:12:27 pm
content: The photo is too blurry to read the part number.A possibility is that the “diode” is actually a SIDAC?I used it once as a simple, one step dimmer.

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 03:14:11 pm
content: I know that it 's blury but this is because of the camera.I can see it my own eyes it 's a 1N4007 diode.

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 04:12:34 pm
content: I want to make a simulation of my dimmer in LTSpice (for educational purposes, to learn a little bit of LTSpice).In C:\Program Files\LTC\LTspiceXVII\examples\Educational I found dimmer.asc (I attached it in case you don't have it)I want to change the Triac to the one I have (BTA12-600B) and the diac to BR-100. (in dimmer.asc I see just 'Triac', something generic and not a specific Triac)How can I do this?

author: Ian.M
author_rank: Super Contributor
timestamp: August 19, 2018, 06:09:22 pm
content: You'd need LTspice compatible models for the DIAC and TRIAC you want to use, put the model files (.sub or .lib) in the same folder as the sim, add a .lib statement to invoke each of them and set the part no.s of the TRIAC and DIAC symbol each to the name of a model in your model files.P.S. I *strongly* recommend measuring the iron element's hot and cold resistances by the procedure I described in reply#4. The *ONLY* way that iron can meet its specs for power levels is if the element is a PTC resistance.

author: panoss
author_rank: Frequent Contributor
timestamp: August 19, 2018, 09:14:38 pm
content: Here is what I did yesterday for the diac:1. I created a file named 'BR100_diac.mod.:2. I opened it with LTSpice.3. I added this content (I found ithere) and saved it:Quote4. Right click->create symbol5. Component->AutoGenerated->diacBR100 and the part enters in the schematic.I suppose the procedure is correct, but the model?How shall I know if it 's correct?And the model for BTA12-600B? I haven't found anything.

author: panoss
author_rank: Frequent Contributor
timestamp: August 20, 2018, 07:13:58 am
content: I didas suggested:When cold, Resistance=280 Ohm.Time(seconds)Resistance(Ohm)0"110010"101420"95530"90640"86050"82760"79070"74580"71290"683100"660110"640120"622130"605140"587150"560160"546170"533180"521190"505100"490210"477

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2018, 08:40:51 am
content: Yep. That's a PTC element. At 230V RMS supply, it will initially run at 189W from cold, dropping to 48W (or maybe 44W if you extrapolate to allow for the time delay from disconnecting till the first resistance reading), so with the diode in circuit that would be 22W, which matches up well enough with the iron's specs.The DIAC models from users.skynet.be/hugocoolens don't play well with LTspice. The tabular behavioural voltage source model is problematic due to all the breakpoints in the curve and because it breaches one of the required assumptions for a BV source:Quote from: LTspice helpand the macro model isn't in LTspice compatible syntax.

author: panoss
author_rank: Frequent Contributor
timestamp: August 20, 2018, 08:53:22 am
content: Quote from: Ian.M on August 20, 2018, 08:40:51 amThis (pleasantly) surprises me, I expected that the manufacturer would be too...optimistic, as usually happens with these cheap electronics stuff.Quote from: Ian.M on August 20, 2018, 08:40:51 amSo, where can I find the correct models for the diac and the triac (BR100 & BTA12-600B)?

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2018, 09:32:11 am
content: Well you can *try* converting the macro model from users.skynet.be/hugocoolens to LTspice syntax:Code:************************************************************************* BR100: Diac, breakover voltage 32V, breakover current 10uA* Pkg: Do-35, Ref: Philips, measured I-U characteristic by H. Coolens* modelled phenomenologically as a current-dependent voltage source* rise/fall times from parallel capacitance/serial resistance too small!* BR100 rise time 1.5us typ. (discharge of 100nF with Ipeak=0.5A)* DB3 rise time 2us max. (10%-90%, discharge of 100nF through 20Ohm)* author: Detmar Welz** Patched for LTspice syntax, but totally untested************************************************************************.subckt BR100 a b params: A=8.5 B=1u C=80mVdiac 1 a dc 0 ; ammeterCdiac 1 b 1n ; important for stabilityRdiac 1 2 1Bdiac b 2 v={A}*atan(i(Vdiac)/{B})/i(Vdiac)**{C}.ends BR100************************************************************************but don't blame me if it gives convergence errors or stalls the LTspice engine! Use with misc\DIAC.asy.You got lucky - BTA12-600B is in the Triac_st library at LTwiki.org:http://ltwiki.org/files/LTspiceIV/lib/sym/ValVol/ST/thyristors_st/triac/Triac_st.libDownload it and use with misc/TRIAC.asy byCode:.lib Triac_st.lib

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2018, 09:46:21 am
content: Just a thought - I *think* that iron could be temperature controlled by a smart enough controller. If you run it from DC, the current through it can be used to calculate the element resistance, which can give you the element temperature, and, if the thermal resistance to the tip can be characterised, the bit temperature could be modelled from the excess power required to maintain the element temperature over that with the iron at rest.The devil would be in the details - maybe full wave rectify the mains then use a MCU to do fast PWM with a MOSFET, sensing the voltage and element current during the PWM on time. However the firmware would be non-trivial to write.

author: panoss
author_rank: Frequent Contributor
timestamp: August 20, 2018, 09:59:20 am
content: Quote from: Ian.M on August 19, 2018, 06:09:22 pm1. I created a file BR100.sub in the same folder as my .asc file2. I put as content of BR100.sub the text you posted.3 . I put op: .inc F:\LtSpiceProjects\dimmer_1\BR100.sub (in folder F:\LtSpiceProjects\dimmer_1 are located the dimmer_1.asc and the BR100.sub files)4. I don 't understand what you mean by 'set the part no.s', can you explain a bit more?What I also did:I put a generic diac, the one included in LTSpice, right clicked it and as 'SpiceModel' I entered 'BR100'. Is this correct?Quote from: Ian.M on August 20, 2018, 09:46:21 amSoundsveryinteresting.But I would need a rather hard to find PSU, an SMPS that would convert 230VAC to 230VDC...(30 Watts??)

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2018, 10:34:58 am
content: Place a DIAC (misc\DIAC.asy) and right click its attribute:value which is initially 'DIAC' and change it to 'BR100'.If the model file is in the same folder as the sim, you don't need the full path in a .inc or .lib statement, so chop that down to:Code:.inc BR100.subFor the DC supply, if the controller is measuring both the voltage and the current, simply full wave rectify the mains and *DON'T* use a reservoir capacitor. The resulting waveform peaks at 325V (assuming 230V mains) but the RMS voltage is only 230V. Use a separate supply for the MCU e.g. the board from a basic USB charger wallwart.PWM the full wave DC at lets say 31KHz with 50% duty cycle, and you'll have the same power level as the switched diode gave. Ideally the PWM should be just above the audio frequency range, but if you don't mind the risk of it 'singing' a bit, a lower PWM frequency could be used - which will be necessary if the MCU's ADC isn't fast enough to take at least two samples during the PWM period, one for voltage and the other for current.

author: panoss
author_rank: Frequent Contributor
timestamp: August 20, 2018, 11:08:34 am
content: In the attached files you can see what I 've made so far. (in the second file is the LTSpice file and the other files needed).So now I have to make the simulation command.For load I have the resistor RL with value={X}, so that I can give it lots of different values?(have I done it correctly?)I guess I 'll have to make a transient simulation (??) which I think that measures the voltages and currents from time 0 to the ending time that we define? With a time step that we also define?Have I got it correctly till now?

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2018, 11:38:22 am
content: You definitely don't want to run a small signal .AC analysis. A transient analysis with.tran 0.1would be a good start - that will run it for five cycles of the 50Hz AC. Try.param X=1200to start, as that's the approximate hot resistance of the element.If you have problems with the DIAC models, try one of the one inhttp://ltwiki.org/files/LTspiceIV/lib/sym/ValVol/ST/thyristors_st/diac/Diac_st.lib. Type DB4 looks like a likely candidate.

author: panoss
author_rank: Frequent Contributor
timestamp: August 20, 2018, 01:56:20 pm
content: I get this error when I try to run the simulation:'Analysis: Time step too small; initial timepoint: trouble with u2:1:dak-instance d;u2:1;_dak1'(u2 is the triac).I changed the Triac 's value from 'BTA12-600B' back to 'TRIAC' (so it 's the generic triac that comes with LTSpice) and this also gives me an error!!: 'Unknown subcircuit called in: xu2 n001 n005 n007 triac'

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2018, 04:33:47 pm
content: There is *NO* LTspice default TRIAC model. The models for \examples\educational\dimmer.asc are embedded on the schematic. Copy what you need to your schematic.

author: panoss
author_rank: Frequent Contributor
timestamp: August 20, 2018, 04:43:27 pm
content: This one in the attachment works!I change the value of R1 from 0 Ohm to 300k and I get logical results of voltage at B.(I tried in this the BR100.sub but it fails, so I guess the model is not correct)

author: panoss
author_rank: Frequent Contributor
timestamp: August 20, 2018, 05:02:18 pm
content: But all in one file is better (see attachment), this is the LTSpices 's example and this works fine too.It 's better to have the models of the diac and of the triac on the schematic so I can very easily modify them. (I think)So what should I change in the diac 's model?

author: panoss
author_rank: Frequent Contributor
timestamp: August 20, 2018, 08:53:31 pm
content: The Triac_st.lib is for PSpice:'************************************************************************ Triacs PSpice Models ************************************************************************'

author: Ian.M
author_rank: Super Contributor
timestamp: August 21, 2018, 12:29:30 am
content: So?As LTspice is propritary to Analog Devices (formerly Liner Technology) and PSpice is from Cadence, who have no direct interests in semiconductor fabrication, many competing manufacturers release models in PSpice format.There are only a few syntax differences between PSpice and LTspice, which means many PSpice models will work unchanged. However when one doesn't work with LTspice one has to be somewhat of a SPICE expert to figure out why, and possibly patch it.Models found on LTwiki.org *generally* run OK unless you are unlucky and hit an edge case.Try the attached, which uses the ST DIAC and TRIAC models from LTwikiN.B. if you have previously downloaded older versions of Diac_st.lib or Triac_st.lib *AND* installed them to your LTspice lib\sub directory, they may throw errors. Either disable them (rename to .off) or replace them with the more recent ones this sim ferrets.

author: panoss
author_rank: Frequent Contributor
timestamp: August 21, 2018, 09:33:24 am
content: This works fine! (except for the .ferret commands but I downloaded them manually, so no problem)I think I found something.The circuit (see attached files) without C2 and R2 seems to work fine (plot_a). (the DLoad is the diode inside the iron)With C2 and R2 when R1 gets over 50kOhm the output voltage begins to...drop...(plot_b)So, for a start, I should remove C2 and R2. (don 't ask me why I put them there in the first place, I found the circuit on the internet and I used it because it was commented (by others who built it) as a good working dimmer)

author: Ian.M
author_rank: Super Contributor
timestamp: August 21, 2018, 11:18:02 am
content: I don't see the problem. It isn't the output voltage that matters, its the proportion of the cycle for which the TRIAC is on. R2 & C2 just increase the maximum phase shift so the load power can be dropped all the way to near zero.However, without a better model for the BR100 DIAC, this is all just a sim-w@nk as its behaviour critically interacts with the RC network to determine the firing delay. If you don't have a good model for it, you cant determine its influence on the firing angle.You also need to distinguish between three layer DIACs and five layer SIDACs which may be misnamed as DIACs as their application usage is very similar. Seehttps://www.radio-electronics.com/info/data/semicond/diac/diac.phpA DIAC has a continuous I V curve, but a SIDAC does not, so a good DIAC model wont be a good SIDAC model and visa versa.Seehttp://www.semicon-data.com/js/geoms/Va/BR/BR100.jpgThe curve is continuous so its obviously a true three layer DIAC.Unfortunately, if you set up a simple test jig sim with a DIAC driven by a current source, to sweep the current through the DIAC, then plot the current on the vertical axis and the voltage across it on the horizontal axis, you can plainly see the DIAC models from examples\educational\dimmer.asc and LTwiki Diac_st.lib have characteristics nothing like the curve in the (better) BR100 datasheets. The tabular model from users.skynet.be/hugocoolens you first tried to use is close, but, as we found out the hard way, gives simulation problems in realistic dimmer circuits.

author: panoss
author_rank: Frequent Contributor
timestamp: August 21, 2018, 02:04:15 pm
content: Quote from: Ian.M on August 21, 2018, 11:18:02 amBut 'proportion of the cycle that the Triac is on' and 'output Voltage'...aren't these two magnitudes proportional?I think I made a mistake, I checked the output at B while it woud be more correct to check the output A-B (VA - VB to be more accurate), right?So:I hovered the crosshair mouse pointer over A, it turned to a red probe, left-clicked the mouse and holding it down, I drag it to point B, where it got black (probe) and released it. So I have the plot of VA-VB (for various values of R1). Am I doing it right?Also, there is a second 'small circuit' (B1, R22 and C3), I suppose this gives the plot of the power?I clicked on loadPower label and a new plot was created. I edited it and changed it's algebraic expression to 'V(A,B)*I(Rload)'.This is how it 's supposed to be used?(see the attachment)

author: Ian.M
author_rank: Super Contributor
timestamp: August 21, 2018, 03:23:10 pm
content: Because the TRIAC is switching a sinusoidal waveform, and is synchronised to that waveform, the average (or RMS) voltage is *NOT* proportional to the duty cycle. On-time near the 'tails' of the half-sinewave has far less effect than in the middle of the 'hump'.Yes, the click-drag method of selecting a signal and a reference is correct. The only caution is that if you don't drag to a valid point to probe (e.g. because the wire between two components is too short to probe), it will use ground as the reference so check the trace V() expression has a comma in it.Yes the small circuit is for load power as stepped data sets cant be integrated, so you cant just zoom to N full cycles then Alt-click the load resistor to compute it. The circuit computes the average power in the load via a behavioural source feeding a voltage numerically equal to the instantaneous power through a low pass filter with a time constant of 50ms. To plot averaged load power, plotV(LoadPower)*1A. The *1A converts the units to watts so it gets its own vertical scale on the plot. If you don't mind reading it out as a numerically equal voltage, you can omit the *1A.It has quite a bit of ripple and you need to run the sim for at least 200ms for it to settle, hence the original run time of 300ms. Increasing the time constant to further reduce the ripple would require a proportionately greater runtime. Zooming in closer than 50ms full width isn't useful as it wont show enough cycles of the ripple for you to estimate the average power, so your plot above isn't useful.

author: panoss
author_rank: Frequent Contributor
timestamp: August 21, 2018, 09:37:35 pm
content: Ok but after all this I still don 't know how to 'evaluate' this circuit. To say if it 's good or bad, or to say how good it is, what should be improved and how the internal diode of the soldering iron affects on it 's functionality.To check if it works as expectedI should check the duration of conduction of the TRIAC in a period.This is what I did (please tell me if it 's the correct way).I removed the directive '.step param X blah blah...'.I entered manually the value for R1=1k.I run the simulation and measured the time the TRIAC conducted (take a look at the attachment).(I repeated the process for other values of R1):f=50Hz->f=1/T->T=1/f->T=1/50Hz=0.02s, convert to ms:0.02s*1000=20ms.D = Ton/T. (Ton=time the TRIAC is on)R1(ohm)Ton(ms)Duty cycle(D=Ton/T)1k1.42ms1.42ms/20ms=0.071=7.1%3k1.69ms1.69ms/20ms=0.0845=8.45%6k2.03ms2.03ms/20ms=0.1015=10.15%10k2.42ms2.42ms/20ms=0.121=12.1%15k2.8ms2.8ms/20ms=0.14=14%30k3.81ms3.81ms/20ms=0.1905=19.05%50k4.93ms4.93ms/20ms=0.2465=24.65%70k6ms6ms/20ms=0.3=30%90k7.19ms7.19ms/20ms=0.3595=35.95%100k7.94ms7.94ms/20ms=0.397=39.7%110k10ms10ms/20ms=0.5=50%We have halfwave because of the soldering iron 's internal diode, so maximum Duty cycle is 50%, everything looks fine, the dimmer works fine.Am I correct?

author: David Hess
author_rank: Super Contributor
timestamp: August 21, 2018, 10:35:47 pm
content: TRIACs (and all thyristors) can have difficulty turning off when driving an inductive load including the leakage inductance of a transformer. The usual solution is to add an RC snubber across the TRIAC to limit dV/dT allowing the TRIAC to shut off.AN1048 - RC Snubber Networks For Thyristor Power Control and Transient Suppression

author: panoss
author_rank: Frequent Contributor
timestamp: August 22, 2018, 06:29:37 am
content: Quote from: David Hess on August 21, 2018, 10:35:47 pmWe don 't have an inductive load here. Our load is a diode in series with a resistor (DLoad, RLoad).

author: Ian.M
author_rank: Super Contributor
timestamp: August 22, 2018, 12:47:31 pm
content: Quote from: panoss on August 22, 2018, 06:29:37 amA snubber network is still advisable, because even with a pure non-inductive resistive load, the TRIAC 'sees' all the wiring inductance, to the element and also back to the wall and from there to nearby appliances with a class X filter cap between L and N. Also, most mains soldering irons use a wound element so, depending on the winding structure, may not be non-inductive.-------------------------------------------I've put together a hopefully improved BR100/03 DIAC model:Code:* Parameterised three layer DIAC model* for LTspice to match cuve of BR100/03* without dicontinuities.* Hand-crufted by Ian.M 22/08/2018*.subckt BR100 T1 T2 params: Vbr=30.5V, Ibr=30uA, Vfr=10.2V, If=10mA, Rs=1, Cp=1nF*Precalculate consts..param K1={1.0141*Vbr}, K2={2.1481/Ibr}, K3={Vfr/Vbr}, K4={-7.0/If}, K5=(Vbr-Vfr)/VbrRdiac N001 N002 {Rs}Vdiac T1 N001 0 ; ammeterCdiac N001 T2 {Cp}B1 N002 T2 v={K1}*tanh({K2}*I(Vdiac))*({K3}*exp({K4}*abs(I(Vdiac)))+{K5}).ends BR100I've tested the model under LTspice in the classic series dimmer circuit.I don't think it can be improved without a selection of BR100/03 DIACs and a curve tracer with a low duty cycle pulsed mode to avoid self-heating.The subcircuit parameters are similar to those in the Philips datasheet, but actual values apart from Ibr matched to Hugo Coolens curve data.The magic numbers in the precalculate constants .param line are:K1, 1.0141, match peak voltage to VbrK2, 2.1481, match 98% Vbr @ Ibr - increase to increase %K4, 7.0, Match exponential to curve data - increase to sharpenAttachments are the dimmer sim and a test jig sim to trace (and compare) model DIAC curves that has this model, the LTspice DIAC model from examples\educational\dimmer.asc, and Hugo Coolens' table based model (the one LTspice barfs on in an actual dimmer circuit).

author: panoss
author_rank: Frequent Contributor
timestamp: August 22, 2018, 02:55:08 pm
content: How about my last post?Is it correct what I wrote or not?

author: panoss
author_rank: Frequent Contributor
timestamp: August 25, 2018, 11:24:00 am
content: Well, I rebuilt the circuit on a proper PCB...Result? The same as before !!The soldering iron works at maximum no matter the position of the potentiometer ...I have put the multimeter in parallel with the soldering iron (at the exit of the dimmer that is) and this is what I get:at DC range: from 0Vdc to 123Vdc.at AC range: 225Vac to 274Vac.

author: Ian.M
author_rank: Super Contributor
timestamp: August 25, 2018, 12:19:35 pm
content: The *only* thing that is unusual about your load is the series diode. I expectit will workthe dimmer will work normallywith an incandescent bulb in parallel with your element + diode load.Edited for clarification

author: Audioguru
author_rank: Super Contributor
timestamp: August 25, 2018, 01:49:29 pm
content: A diode or a light dimmer circuit does notregulatethe temperature of a soldering iron. When the diode is active or the light dimmer is turned down then the soldering iron sitting doing nothing gets hotter and hotter and hotter and hotter and …., but when you use it to solder things it gets colder and colder and colder and colder and ….My old Weller soldering iron does not have many parts (that soon fail) for an adjustable temperature, it uses the Currie magnetic temperature regulating feature so its tip is always at the correct temperature when sitting all day long and when soldering things all day long. I never need to adjust the regulated temperature of my soldering iron.

author: Ian.M
author_rank: Super Contributor
timestamp: August 25, 2018, 02:28:20 pm
content: Also, the iron in question has a PTC element (see reply#18), so the variation of temperature with RMS voltage applied will be fairly small over a wide voltage range.The PTC element already acts to regulate the temperature (poorly as its regulating the element temperature not the bit temperature and theer is a considerable thermal resistance in between) to a predetermined temperature determined by its design. Reduce the duty cycle and thus the RMS voltage, and the element temperature drops, but that decreases the resistance, increasing the current till it reaches a balance at nearly the same power level and at only a slightly lower temperature. As there will typically be a several hundred degree difference between the tip temperature and the solder melting point, unless you have a thermocouple meter designed to measure tip temperature, you'll barely notice the temperature decrease.

author: panoss
author_rank: Frequent Contributor
timestamp: August 25, 2018, 08:12:45 pm
content: Quote from: Ian.M on August 25, 2018, 02:28:20 pmSo this is why this iron 's temperature stays at the same level no matter the position of the potentiometer!Right?

author: Zero999
author_rank: Super Contributor
timestamp: August 25, 2018, 08:21:17 pm
content: Quote from: panoss on August 25, 2018, 08:12:45 pmYes. When the temperature drops slightly, due to the potentiometer setting being reduced, the resistance decreases, resulting in increased power dissipation, causing it to heat up more.

author: Ian.M
author_rank: Super Contributor
timestamp: August 25, 2018, 08:27:58 pm
content: Quote from: panoss on August 25, 2018, 08:12:45 pmIf that's what its doing with a resistive load in parallel with the element + diode, or with the diode shorted out, yes.You can probably see the difference if you put a suitable thermocouple directly on the bit, or if you have a large enough value pot in the dimmer to get the RMS voltage down to about 70V (on a true RMS multimeter's AC V range).

author: panoss
author_rank: Frequent Contributor
timestamp: August 26, 2018, 06:24:25 am
content: Quote from: Ian.M on August 25, 2018, 08:27:58 pmI have no load in parallel with the element + diode.The diode is not shorted out.Quote from: Ian.M on August 25, 2018, 08:27:58 pmHow large?I guess the simulation is wrong because RLoad is a simple resistor.Will it be correct if I replace it with a PTC?(btw I found no thermistor in LTSpice)EDIT: I tried with a 1 megohm pot and seems to work! I think it 's (kind of) dimming the iron!

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2018, 07:54:23 am
content: If your dimmer circuit is a two terminal one (i.e. is entirely in series with the load), you should have a resistor across the load so the trigger circuit still gets current even when the diode in the iron is reverse biassed. 3x 27K 1/4W in series would probably be suitable. (Don't use a single resistor as it almost certainly wont have a high enough voltage rating.)If your dimmer circuit is three terminal (L, N and Load), you shouldn't need the extra resistor as the control circuit always 'sees' the full mains waveform.To fully simulate the circuit, you'd need a thermal model of the iron + a well characterised resistance vs temperature curve for the element. IMHO its not really worth the effort unless you are trying to implement closed loop temperature control using the element resistance for temperature sensing as I proposed in reply#22. Also the thermal time constants are fairly large, so your sim runtimes would be absolutely horrendous. You would probably end up needing to simulate for 10000 mains cycles to get good quality results.

author: panoss
author_rank: Frequent Contributor
timestamp: August 26, 2018, 08:08:14 am
content: Quote from: Ian.M on August 26, 2018, 07:54:23 amQuote from: Ian.M on August 26, 2018, 07:54:23 amMy dimmer circuit is the one published in my first post.Is this a two terminal or a three terminal?With a 1Megaohm potentiometer I read at AC range of my (non true-RMS) multimeter from 20Vac up to 230Vac.And temperature seems to follow the voltage level.So it 's dimming!

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2018, 10:09:56 am
content: Great, its working.Your first post had:That's a two terminal dimmer. IMHO you should add the 3x 27K (series) resistors across OUT-1 and OUT-2, to prevent the diode in the iron totally blocking the reverse voltage to the TRIAC and its trigger circuit.N.B. temperature stability when heavily 'dimmed' will be very poor.

author: panoss
author_rank: Frequent Contributor
timestamp: August 26, 2018, 10:44:46 am
content: My real circuit has two differences from the above circuit:1. R3 is 1k2. R1 (the pot) is 1Megohm.

author: panoss
author_rank: Frequent Contributor
timestamp: August 26, 2018, 11:36:21 am
content: My main goal of this topic is to understand (using LTSpice) how a dimmer works.And how to use LTSpice for understanding how a circuit works.So, let 's consinder RDLoad as anormalresistor...not a PTC one...and there is no DLoad (in it 's place there 's a simple wire).I thought that what the potentiometer does is to change the voltage accross C1.I also thought that (because BR100 has VBO=32.40V):- when Voltage accross C1 >32.40V then Triac conducts.- when Voltage accross C1 <32.40V then Triac does not conduct.So:-when potentiometer has low value, C1 has a higher voltage, it stays longer over 32.40V, TRIAC conducts for more time, output RMS voltage is higher.-when potentiometer has big value, C1 has a lower voltage, it stays shorter over 32.40V, TRIAC conducts for less time, output RMS voltage is lower.Are these thoughts of mine, wrong?

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2018, 12:54:48 pm
content: Not quite right. The TRIAC is a bistable device that latches on. For an ideal one, to set it on, apply gate current. To reset it to off, reduce the current through it to zero.The BR100 DIAC holds off the voltage on C2 till it reaches its breakover voltage. It then allows C2 to discharge rapidly into the TRIAC gate, turning it on, and it stays on till the current though the load falls to zero.I've drawn up the sim, and adjusted it for 10W to the iron. Attached.N.B. I don't like your circuit because its control range with a load containing a diode is very poor and rather unstable, and also the way its arranged with the load on the Neutral side of the dimmer makes it much harder to understand what is happening in the sim.

author: panoss
author_rank: Frequent Contributor
timestamp: August 26, 2018, 01:16:52 pm
content: I run the simulation of dimmer_6 but I don't have the model of BA158, I get an error: 'Can't find definition of model "BA158")'.Why don't you remove the diode so that we will simulate a normal soldering iron with a normal resistor?Quote from: Ian.M on August 26, 2018, 12:54:48 pmHow can I see this on the simulation?

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2018, 02:40:18 pm
content: Its just a fairly generic 1A 600V diode, so replace it with the default diode model 'D'However if you *really* want it:Code:.model BA158 d(is=5u rs=0.1 cjo=22p bv=600 iave=1 vpk=600 type=silicon)The diode in your iron causes a major problem for your dimmer circuit. Please compare the results with the diode and with it replaced with a wire link.To see what's happening, plot the voltage across C1, and C2, and the current into the TRIAC gate. Put the supply voltage (PWR230) and the load current in another plot pane.

author: panoss
author_rank: Frequent Contributor
timestamp: August 26, 2018, 03:02:45 pm
content: At dimmer_6.asc I short circuited D1 and run the simulation.At the attached image you can see the first full wave, from 0ms up to 20ms.VR1 takes 5 different values: 1k, 40k, 70k, 110k and 130k.VR1=10k (Green) from 0ms-2.04ms, rises gradually from -23.97V up to 80.57V. Suddenly at this point (2.04ms) rises to 253.76V.VR1=40k (Blue) from 0ms-3.48ms, rises gradually from -23.97V up to 57.16V. Suddenly at this point (3.48ms) rises to 333.33V.VR1=70k (Red) from 0ms-4.77ms, rises gradually from -23.97V up to 49.36V. Suddenly at this point (4.77ms) rises to 364.54V.VR1=110k (cyan) from 0ms-6.24ms, rises gradually from -23.97V up to 40.00V. Suddenly at this point (6.24ms) rises to 336.45V.VR1=130k (purple) from 0ms-7.15ms, rises gradually from -23.97V up to 40.00V. Suddenly at this point (7.15ms) rises to 253.76V.The voltage accross C1 begins at -23.97V. Isn't this strange? I was expecting it to begin at 0V.When VR1=10k (Green) at simulation time 2.04ms, something happens and voltages suddenly goes from 80.57V to 253.76V.What happens?If it was that BR100 's break voltage was reached, It should lower suddenly the voltage of C1, not increase it.

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2018, 03:14:58 pm
content: Plot the voltage *across* C1:V(vc,out2)

author: panoss
author_rank: Frequent Contributor
timestamp: August 26, 2018, 03:31:59 pm
content: I run it for VR1=40k. To see the voltage across C1: V(vc,out2)...In the attached, I have written some remarks (-questions), are they correct?

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2018, 03:48:47 pm
content: Maybe. Its hard to be certain unless you add a trace for the voltage across the DIAC or for the DIAC gate current.I've redrawn the schematic to move the dimmer to the low side of the load to make it easier to probe voltages in the dimmer control circuit. I've also put a resistor to short out the diode you can .step so you can directly compare the waveforms with and without the diode.

author: panoss
author_rank: Frequent Contributor
timestamp: August 26, 2018, 04:31:58 pm
content: At the attached you can see:voltage across C1 on the top pane andvoltage across the DIAC at the botom pane (dimmer_7.asc).But in each pane there are two lines, a green and a blue...What does this mean?I see the voltage accross the DIAC rises at 0ms-7.90ms, from -28.92V to 29.03V...Never reaches break out voltage...(32.40V)I don't know...I can't explain how it works.

author: Ian.M
author_rank: Super Contributor
timestamp: August 26, 2018, 04:55:38 pm
content: You've got two lines for each trace because the sim runs twice, once with the resistor shorting the diode open (1 Gigaohm) and once with it shorting (1 milliohm).Mod the .step command to:Code:.step param Rshort list 1G 1Meg 1mand you'll see what happens if the series diode in the iron is leaky.When the diode is shorted out, the dimmer needs a much smaller pot setting for the same firing angle. When the diode heats up (and it will in the iron handle) its leakage current will shift the firing angle towards 180 deg, eventually stopping it firing. If you press the boost button it will probably also stop firing!If you don't want to step shorting the diode, comment out its .step command and add:Code:.param Rshort=1Gso Rshort defaults open.

author: panoss
author_rank: Frequent Contributor
timestamp: August 27, 2018, 09:25:01 am
content: See attached files.dimmer_4_2.asc: I 've deleted everything not absolutely necessary. For simplicity.R1 is the potentiometer.R1=10kTRIAC conducts from 101.727ms to 109.813ms=8.086ms.At 101.706ms BR100 (red) begins to conduct (Vc=56.31V (green), VC2=28.23V(blue)) and ends at 101.730ms=0.024ms conduction time of BR100.At 101.727ms,TRIAC(cyan) begins to conduct. Latches on and remains latched till 109.813ms (conduction time of TRIAC=8.086ms), when current through TRIAC falls at 15,32mA(purple).At this point the TRIAC stops conducting, current through it falls to 0.R1=80kTRIAC conducts from 104.919ms to 109.813ms=4.894ms.At 104.883ms BR100 (red) begins to conduct (Vc=41.31V (green), VC2=29.67V(blue)) and ends at 104.922ms=0.039ms conduction time of BR100.At 104.919ms,TRIAC(cyan) begins to conduct. Latches on and remains latched till 109.813ms (conduction time of TRIAC=4.894ms), when current through TRIAC falls at 15,32mA(purple).At this point the TRIAC stops conducting, current through it falls to 0.So change of R1 caused a change of Vc which caused a change in time when TRIAC latches on:with R1=10k->Vc=56.31V->latches on at 101.727ms,with R1=80k->Vc=41.31V->latches on at 104.919ms,while the time it goes off (109.813ms) remains stable.This way, the duration that the TRIAC stays on changes.Please correct me if I 'm wrong in something.

author: Ian.M
author_rank: Super Contributor
timestamp: August 27, 2018, 10:28:49 am
content: LTspice has a nasty little gotya - you cant have two names for the same net, and Gnd (node 0) overrides any other name you assign to that net. Therefore naming the supply side of the load 'A' currently has no effect in your sim. The fix for that is to put a 1u resistor between 'A' and the Gnd symbol to split the nets. I've also added a few node labels, and fixed the power voltage source expression so the result is positive. Fixed up sim plus plot file attached.Apart from that, you seem to have gained a good understanding of what's going on in the actual circuit. Now you have that, you should be able to determine why it misbehaves if you leave the series diode + shorting boost switch in your soldering iron active. Hint: look at the charge on C1 at the start of the active half-cycle with the diode and with it bypassed.

author: panoss
author_rank: Frequent Contributor
timestamp: August 27, 2018, 04:48:50 pm
content: I can 't understand how excactly the value of the potentiometer defines the time the DIAC will start conducting. (the time that the voltage accross the DIAC will become equal to it's break out voltage)

author: Ian.M
author_rank: Super Contributor
timestamp: August 27, 2018, 05:10:19 pm
content: That's *HARD*. Start by simplifying it by getting rid of R2 and C2, with the DIAC direct to C1 and make C1 200nF to compensate for removing C2. Now consider a half cycle of mains. C2 charges through R1+R3 till it reaches the DIAC breakover voltage (+ a tiny bit for the forward drop of the TRIAC gate PN junction). The DIAC then conducts and the TRIAC fires. 1/(R1+R3) is the constant of proportionality between V(L)-V(vc1) and the charging current into C1. If you halve the resistance it charges twice as fast for the same voltage differential *BUT* the voltage differential does *NOT* stay the same so the firing angle will *NOT* be exactly halved.You can write an equation for C1 charging, given the initial voltage and the value of C1, R1 and the RMS main voltage, and solve for when it reaches the breakover voltage, but it isn't a nice simple linear or exponential equation because the supply voltage is varying sinusoidally. Also the residual charge on C1 from the previous half cycle is dependent on the length of time the TRIAC was fired for and on poorly documented parts of the DIAC's characteristic curve, so although you can get some idea by working it out in full or letting a SPICE package solve the equations for you if you've got good enough models, there is no practical alternative to testing the actual device to determine the relationship.