Practical discussion of zero voltage switching and phase switching using a TRIAC in a 230 volt 50Hz alternating current circuit. The details are not important, try to see the big picture.
A 230 volt 100 watt old fashioned light bulb has a filament resistance of around 40 ohm at room temperature. Connect 230 volt AC mains to the bulb and it will draw/pass more than 5 amp, which implies that the bulb has a power rating in excess of 1 000 watt.
The bulb’s filament runs at 2 500 degrees C when fully on, which increases the resistance to more than 500 ohm, so the current drops to less than ½ amp. How long does it take for the filament to reach this temperature? Faster than the eye can see!
It is not good for a filament to receive a thermal shock like this and one way to reduce it is to allow more time for the turn-on warm-up.
If we were quick enough, we could wait for the mains cycle and as it passes through zero, quickly flip the switch on, but a TRIAC is fast enough. By switching near the zero crossing point, voltage is near zero, so current is near zero and this helps to reduce switching noise or EMI as well as thermal shock in some cases like the filament in a light bulb.
But even when switched at zero, the filament will receive an increasing voltage of 0 to 325 volt in a matter of 5 milliseconds! This is much better than bang on near the peak voltage, but there is yet a better method. What if you could apply only 10 volt for a short while, then 20 volt for a short while and gradually increase the voltage so that there is much more time to heat the filament?
This is one example where phase control comes in handy. A TRIAC can turn on when there is a voltage across it and if a current can flow through it. If the current stops, the TRIAC will turn itself off. This is what happens at the mains zero crossing point. The current drops to zero as the voltage switches polarity and the TRIAC turns off by itself.
Now that we know how to turn it off, when does it turn on in order to slowly step up the voltage across the load? If you want only 10 volt on the load, wait until the mains voltage decreases towards zero and when it reaches 10 volt before zero, trigger the TRIAC. It will stay on for a very short time because the voltage is rapidly declining to zero, where the TRIAC will turn itself off.
As the voltage rises in the opposite polarity, don’t turn on at (the first) 10 volt, it is too soon. Wait for the voltage to rise and fall and just before it reaches zero, turn it on again. If you switch a light bulb like this, it will barely come on, but slowly increase the voltage at which you trigger the TRIAC and it will conduct longer and longer. This is what most light dimmers do.
The trick is to calculate the switch-on position before the next zero crossing point. In practice, you use a timer rather than a voltage. Take a 16-bit timer with a 2MHz clock, which is common in modern micro controllers.
One half-cycle at 50Hz is 10 milliseconds and the timer will count to 20 000 in this time, then the next zero crossing will occur. For phase control, the trigger point is the number of counts before reaching 20 000. There are a number of ways to do this. One simple, not always ideal method is to use the counter’s overflow to generate an interrupt and trigger the TRIAC in the interrupt code. This means that the timer has to be pre-set with a value close to the full count.
To get an overflow after 10 000 counts, deduct 10 000 from the full count (65 536 – 10 000) and pre-load the timer with this value at each zero crossing. The timer will start 55 536 and 10 000 counts later, an overflow interrupt will be generated.
By exceeding a 16-bit counter’s capacity, a carry is formed and this can be selected to trigger an interrupt. The interrupt is used to stall other processes and immediately deal with the TRIAC’s trigger, otherwise if other software is allowed to run, the TRIAC’s trigger timing will be messed up. The interrupt says, I have to quickly do this, and then you can carry on with what you were doing.
To conclude, TRIACS are not often used in DC circuits because the current never stops, so it is not easy to turn the TRIAC off. There are exceptions like a crow bar protection circuit. The TRIAC or SCR sits across the DC supply, right after a fuse. If the TRIAC is triggered, it will short circuit the supply and quickly blow the fuse. When the fuse blows, current is interrupted and the TRIAC turns off before it is smoked and protected the circuit at the same time.
There used to be more complicated applications in DC circuits, but it is easier these days to use transistors than to deal with the complications of stopping the current through a TRIAC in a DC circuit without turning the DC off.