Author Topic: Problem with DIY dimmer  (Read 8134 times)

0 Members and 1 Guest are viewing this topic.

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #25 on: August 20, 2018, 11:08:34 am »
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?
« Last Edit: August 20, 2018, 11:30:04 am by panoss »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #26 on: August 20, 2018, 11:38:22 am »
You definitely don't want to run a small signal .AC analysis.  A transient analysis with .tran 0.1 would be a good start - that will run it for five cycles of the 50Hz AC.  Try .param X=1200 to start, as that's the approximate hot resistance of the element.

If you have problems with the DIAC models,  try one of the one in http://ltwiki.org/files/LTspiceIV/lib/sym/ValVol/ST/thyristors_st/diac/Diac_st.lib.  Type DB4 looks like a likely candidate.
 
The following users thanked this post: panoss

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #27 on: August 20, 2018, 01:56:20 pm »
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!! :o : 'Unknown subcircuit called in: xu2 n001 n005 n007 triac'
« Last Edit: August 20, 2018, 03:39:55 pm by panoss »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #28 on: August 20, 2018, 04:33:47 pm »
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.
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #29 on: August 20, 2018, 04:43:27 pm »
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)

 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #30 on: August 20, 2018, 05:02:18 pm »
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?
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #31 on: August 20, 2018, 08:53:31 pm »
The Triac_st.lib is for PSpice:
'***********************************************************************
*             Triacs PSpice Models                  *
***********************************************************************'
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #32 on: August 21, 2018, 12:29:30 am »
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 LTwiki

N.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.
 
The following users thanked this post: panoss

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #33 on: August 21, 2018, 09:33:24 am »
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)
« Last Edit: August 21, 2018, 09:40:02 am by panoss »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #34 on: August 21, 2018, 11:18:02 am »
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. See https://www.radio-electronics.com/info/data/semicond/diac/diac.php
A 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.

See http://www.semicon-data.com/js/geoms/Va/BR/BR100.jpg
The 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.
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #35 on: August 21, 2018, 02:04:15 pm »
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.
But '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)

 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #36 on: August 21, 2018, 03:23:10 pm »
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, plot V(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.
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #37 on: August 21, 2018, 09:37:35 pm »
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 expected I 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?
« Last Edit: August 22, 2018, 07:01:58 am by panoss »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16615
  • Country: us
  • DavidH
Re: Problem with DIY dimmer
« Reply #38 on: August 21, 2018, 10:35:47 pm »
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
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #39 on: August 22, 2018, 06:29:37 am »
TRIACs (and all thyristors) can have difficulty turning off when driving an inductive load including the leakage inductance of a transformer.
We don 't have an inductive load here. Our load is a diode in series with a resistor (DLoad, RLoad).
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #40 on: August 22, 2018, 12:47:31 pm »
TRIACs (and all thyristors) can have difficulty turning off when driving an inductive load including the leakage inductance of a transformer.
We don 't have an inductive load here. Our load is a diode in series with a resistor (DLoad, RLoad).
A 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: [Select]
* 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)/Vbr
Rdiac N001 N002 {Rs}
Vdiac T1 N001 0 ; ammeter
Cdiac N001 T2 {Cp}
B1 N002 T2 v={K1}*tanh({K2}*I(Vdiac))*({K3}*exp({K4}*abs(I(Vdiac)))+{K5})
.ends BR100
I'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 Vbr
K2, 2.1481, match 98% Vbr @ Ibr - increase to increase %
K4, 7.0, Match exponential to curve data - increase to sharpen

Attachments 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).
« Last Edit: August 22, 2018, 04:14:42 pm by Ian.M »
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #41 on: August 22, 2018, 02:55:08 pm »
How about my last post?
Is it correct what I wrote or not?
« Last Edit: August 22, 2018, 04:09:06 pm by panoss »
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #42 on: August 25, 2018, 11:24:00 am »
Well, I rebuilt the circuit on a proper PCB...
Result? The same as before !! :o
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.
« Last Edit: August 25, 2018, 11:32:37 am by panoss »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #43 on: August 25, 2018, 12:19:35 pm »
The *only* thing that is unusual about your load is the series diode.   I expect it will work the dimmer will work normally with an incandescent bulb in parallel with your element + diode load.     

Edited for clarification
« Last Edit: August 25, 2018, 02:38:43 pm by Ian.M »
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Problem with DIY dimmer
« Reply #44 on: August 25, 2018, 01:49:29 pm »
A diode or a light dimmer circuit does not regulate the 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. 
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #45 on: August 25, 2018, 02:28:20 pm »
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.   
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #46 on: August 25, 2018, 08:12:45 pm »
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.
So this is why this iron 's temperature stays at the same level no matter the position of the potentiometer!
Right?
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19522
  • Country: gb
  • 0999
Re: Problem with DIY dimmer
« Reply #47 on: August 25, 2018, 08:21:17 pm »
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.
So this is why this iron 's temperature stays at the same level no matter the position of the potentiometer!
Right?
Yes. 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.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Problem with DIY dimmer
« Reply #48 on: August 25, 2018, 08:27:58 pm »
So this is why this iron 's temperature stays at the same level no matter the position of the potentiometer!
Right?
If 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).   
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: Problem with DIY dimmer
« Reply #49 on: August 26, 2018, 06:24:25 am »
If that's what its doing with a resistive load in parallel with the element + diode, or with the diode shorted out, yes.   
I have no load in parallel with the element + diode.
The diode is not shorted out.

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).
How 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!
« Last Edit: August 26, 2018, 07:31:15 am by panoss »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf