Blogs

Dimmer - Sine Wave Dimmer

Light Dimmers have gone through several design generations. Originally, dimmers were contructed out of resistive bridges or autotransformers. These were big and lossy (hot!). In the 60s, SCRs where invented. These were followed by Triacs. These solid state devices were much more compact and efficient (cooler). Recently, IGBTs have been used to make even smaller and cooler devices.

However, SRCs, Triacs and IGBT designs have a problem that until recently was not an issue. That is, they generate a lot of EMI. That is because they switch at very low frequencies (multiples of 60Hz). By 'clipping' the 60Hz signal at various places in the cycle, you generate a lot of harmonics that get reflected into the power source or into the load. To mitigate this situation, designers have resorted to putting large output filters on the devices to contain the harmonics. However, recent/pending policy decisions might require that harmonics be reduced farther than what is presently considered acceptable. It this becomes the case, the required filters will become too large for many applications.

One advantage the old resistive/autotransformer designs had was that they generated no harmonics. Sine wave in. Sine wave out. A Power Factor of one. They could drive resistive, capacitive and inductive loads. Phase dimmers (Triacs and IGBTs) can't do that.

There is a new generation of dimmers coming onto the market that have the advantages of both the old designs and the new designs. They are called 'Sine Wave Dimmers' or 'PWM Dimmers'. They are compact and efficient. They transform a sine wave from one power level to another. I couldn't find many designs floating around on the web. However, there are patents.

Sine Wave Dimmers operate by pumping the current through the dimmer at very high frequency. In doing so, they are free to vary the duty cycle of the pump to control the power delivered to the load. If the switching frequency is high enough, then the effects of the switching can be filtered away by a somewhat small filter -- leaving only the low frequency (60Hz) power.

One approach that seems to be prevalent is to treat the dimmer as a switch mode power supply and treat the light as the load. The idea is to filter the power supply lines (but pass the 60Hz) and then use matched switches to pump the positive and negative cycles through an output filter (an LC filter) which has the load in parallel. Active clamps are used to reduce the ringing in the circuit. By varying the duty cycle of the switches, the amount of current that passes through the load can be controlled (thus controlling the power). I have tried a simplified/modified version of this approach below.

One requirement Jon and I have is that the dimmer be able to replace existing dimmers. It is common practice for electricians to bus the neutrals together in multi-dimmer panels. They do this because they think of the neutral as ground and the phase as providing the power to the load. They don't expect the dimming device (and most commercial dimmers don't) to insert any electronics between the load and ground. Thus, very often, it is not easy to spot the neutral wire running to a specific load in a multi-dimmer box.

Another requirement we have is that the dimmer present AC power to the load. One approach to solving this problem is to simply make a DC to DC buck converter and be done with it (in fact, this is how LED dimmers are done). However, DC currents tend to reduce the light-span of incandecent bulbs. They are also inapropriate for other types of loads (fans, motors, ..etc).

Here is the schematic for my experiment. In this design, I am trying to pump the current through the load and filter away the high frequency switching effects. To do this, I use the inductor (L1) and output capacitor (C1) as a high pass filter. The idea is to let these components pass the high frequency stuff and leave the 60Hz signal for the load. The LC filter formed by L1 and C1 has a cutoff frequency of about 33KHz. However, the load resistance can be as high as 1500 ohms (for a 10W load). This makes the filter resonant at 33KHz so it is important to stay well away from that frequency.

I decided to pump the circuit at 100KHz and live with some bigger components. This is just a demonstration at this point so I decided to keep the frequency well within the capabilities of the MOSFET I am modeling (an IRF840).

Here are some results:

Results. Here is the power (purple), voltage (red) and current (green) waveforms across the load. The current is hard to see because the power curve dominates the y-axis. Notice how clean these curves are! This is a 280W load (100 ohms) at 50% duty cycle. Notice that the power is no where near half of 280W. The power control does not vary linearly with the dutycycle in this technique. I haven't looked into the cause yet. However, I have tried dutycycles from 95% to 5% with success. At 5%, this load was less than 10W.
FFT. Here is the FFT of the power, voltage and current. Notice that the harmonics start at 100KHz and go up from there. Also notice that they are small and well defined. This is in contrast to the phase dimmers which have large harmonics starting at 120Hz and assending.

Dimmer - Random Phase Light Dimmer Using IGBT, Second Try

I previously mentioned that Jon wanted to try and simplify the design be getting rid of the photocoupler and the circuit that powers it. His reasoning was that it was just more stuff that could break. So, I moved the main power supply inside the bridge and referenced it to the 'bottom' of the bridge. This means we can drive the IGBT directly.

Here is the schematic for what Jon and I call the 'Inside Power Supply' design. Notice that this is a much simpler design.

The inspiration for this design can be found in this app note from ST Micro.

If I set the dimmer's duty cycle to 50%, then here is the first 300ms.

The green curve is the 6V power rail for the opamps. The red curve is the 3.3V power rail for the CPU (and it ADC). The yellow curve represents the current through the load. The purple curve represents a half cycle of the voltage. The idea is to take the yellow and purple curves and feed them into two ADC inputs on the CPU and do the power calculation in the CPU.

Here is a detailed shot of a couple of cycles.

Here is the power dissipation across one of the bridge elements.

Here is the power dissipation across the IGBT.

Here is a detailed shot of the power dissipation across the IGBT.

So, at 50% dimming with a 570W (25ohm) load, the power dissipation of the 'ramp' is 16.76mWs (= 8W * 4.19ms * 0.5 Estimating it to be a triangle). The power dissipation of the 'spike' is 420uWs (= 280W * 3us * 0.5 Esitimating it to be a triangle). Over the course of a half-cycle, that is an average power dissipation of 2.15W (= (16.7mWs + 0.42mWs) / 8ms).

I did this experiment with 50% dimming and a 1KW (14.4ohm) load, the power of the 'ramp' peaks at 18W and the 'spike' goes to 480W. At those numbers, the average power dissipation is 3.4W

Hmm... That seems like a lot of heat to dissipate.

***** EDIT 2010-06-15 *****
I have been messing around with this design and have decided to abandon it. The reason is that the power supply is too dependent on the load. If you remove the load (take the light out of the light socket), then the power supply stops working. I thought we had avoided this issue by making the power supply tap the neutral directly. However, since the return path is still through the load (when phase is high), the flow of current is blocked by no load. This makes the power supply 'freeze'. It works with very light loads. However, if you attach a 10K resistor or less to the output of the load, then it freezes (Spice refuses to converge).

Dimmer - Random Phase Light Dimmer Using IGBT

Jon found some examples of light dimmers constructed using FETs and IGBTs. He was intrigued by these dimmers because they apparently had no filter inductor like triac based dimmers. That inductor can be quite large for higher amperage and make small/compact layout difficult. Also, these dimmers could be triggered at any point in the AC cycle which means they can be switched at points where the EMI can be minimized.

Triac based dimmers work by 'squelching' the current through the load at the zero crossing point and then turning on the current later in the half-cycle. These so called 'trailing edge' dimmers have a problem however. Turning on the current near the peak of the voltage (say, for 50% dimming) leads to a lot of unwanted EMI because the current snaps to full in a very abrupt manner. To keep EMI from bleeding back into the power grid, designers have put large LC filters (100uH inductors and 470nF/250V capacitors) on the mains. These filters consume a lot of space and can be expensive (especially the inductors).

To avoid these problems (noise, space), designers have turned to IGBTs and FETs. These devices can be turned on at the zero-crossing point (a very quiet place because there is no energy to switch at that point) then later, turned off 'slowly' so as to squelch the current with minimal EMI. IGBTs are especially suited for this task because they can be made to turn off slowly.

Of course, FETs and IGBTs are unidirectional. However AC power to a light is bidirectional so you have to come up with a way of rectifying the current and making it pass through the FET or IGBT in only one direction. This is accomplished by using a full wave rectifying bridge. By placing the load on the 'outside' of the bridge and placing the switch (either a FET or an IGBT) on the 'inside', then current can be controlled while still maintaining positive and negative voltage swing around the load.

The full wave rectifier does present a problem, however. The switch referenced to the inside of the bridge. However, you want to construct a power supply for the rest of the dimmer that is outside the bridge so that it is unaffected by the load. Once you do this, the switch control logic is most likely referenced to something very different than the switch itself. To get around this problem, you have to opto-couple the switch and the switching logic. Easily done with an optocoupler and a few components.

Here is a schematic for what Jon and I call an 'outside power supply IGBT dimmer'. In this example, the power supply is just a capacitive dropper (transformerless power supply) with an impossibly large dropper capacitor (C1 = 10uF). This was done just to accomodate Spice. Notice that the power supply is driven directly from 'phase' and 'neutral'. This makes it independent of what is going on with the load and the switch. Also notice that the power supply is referenced to 'phase'. This is because we wanted to locate the shunt in the phase path to prevent requiring the installer from breaking the neutral connection. All the sensors (current, voltage, reference) are referenced to this ground making it possible to measure the voltage drop across the shunt resistor without having to get rid of high common mode voltage.

We are using the IRG4BC20S IGBT in this example. It is pretty big for our purposes (our maximum current is only 10A) but I had a good spice model for it already so I just used it for this simulation. Notice that the IGBT is driven from an optocoupler (U1). The power supply for the IGBT side of the optocoupler is fed directly from neutral so it is not effected by what is going on with the load.

Below is a picture of the simulation output. The green curve is the 6V power supply used to supply the sensor opamps. The red curve is the 3.3V power supply used to run the zero crossing detector(Q4 & Q5). The deep purple curve is the voltage reference used as an offset for the sensed AC voltage. The sensed AC voltage is the yellow curve. And finally, the light purple curve is the sensed current. Notice that the voltage is a full sine wave, but the sensed current is only half of a half AC cycle. This is because the dimmer (simulated with V2) is set to 50%. It is also due to the fact that the shunt is only active for half a cycle. Thus, the current in the circuit is actually double what you see in the light purple curve. If another shunt was placed on the neutral side, then you should see equal (but positive going) quarter cycles when the AC voltage goes positive.

***** EDIT 2010-06-15 *****
I have been messing around with this design some more. I decided to just tap the power coming into the bridge to power the photocoupler instead of making an independent tap to neutral. This means that the photocoupler, which triggers the IGBT, will be dead when there is no load. However, this should not be a problem since there is no load. :)

Here is the new schematic.

Below are some measurements of the voltage (red) and current (purple) across/thru the load. Also, the supplied voltage (green) is shown.

Result. Here are the first 500ms of operation. It takes about 100ms for the potocoupler power supply to get up to voltage. After that, you can see the voltage and current clipped. The duty cycle was set to 50%.
Result Detail. Here is a close-up of a couple of cycles.
FFT. Here is an FFT of the voltage and current across/thru the load and an FFT of the power source. As expected, there are a lot of harmonics since the switching frequency is so low.
FFT Detail. Here is a close-up of the first couple of harmonics.

Dimmer - Spice Tests

I have been messing around with the Dimmer and Spice recently. After spending countless hours trying stuff out on the bench, I decided to put the design in Spice so I can test things more rapidly. Also, Spice lets me try things that would normally smoke on the bench. :)

Jon wants the current shunt on the high side of the load. He wants this because most household light switch boxes have their neutrals bussed together with the individual hots broken out for each load. In a single switch box, the hot and neutral going to the load are obvious. However, in a multiple switch box (a 'gang' box), the neutrals are connected together at a single wire nut. So, for installation sake, it is better to put the current shunt on the high side.

High side current measurements are difficult because of the high common mode voltages present on the high side. In the US, the peak of this common mode voltage is 170V. However, the voltage drop across the shunt is only a few 10s or 100s of millivolts. The INA148 from TI can actually pick this differential voltage off this high common mode voltage, but it is expensive (>$3 in Q1000).

To solve this, we decided to make a power supply that is referenced to the hot line. Working with this high of a voltage on the bench is a hazzard so I decided to try it in Spice. This worked well as you can see below. It let me try many different combinations/tweeks without the hassle and danger of doing it on the bench.

Here is the schematic
Here is one second of simulation
Here is a couple cycles of the simulation

In the schematic, notice that the high side is my ground reference. Also notice that the current shunt and triac are both on the high side. By referencing the power supply to the high side, I am able to read the differential voltage across the shunt and directly gate the triac without worrying about high common mode voltage. One downside to this technique, however, is that hot power supplies may not pass regulations. That is another research topic.

In the simulation results, notice that the data is pretty messed up the first 300ms. This is because it takes that long to get the power rails up and stable. After about 400ms, the results begin to look pretty good. The 'CurSense' (green) and 'VolSense' (red) signals are supposed to oscillate around the reference (VREF, purple). The yellow signal (hard to see) is my zero crossing detector output. It droops on the top because I am drawing too much current from it for the triac trigger.

In the simulation detail, notice that the CurSense signal if flat/zero for the positive half of the cycle. This is because the zero crossing detector is positive which drives the triac gate off. Also notice that the CurSense signal does not increse until after a short delay past the zero crossing. This is because R23 is chosen to fill C12 slowly, thus creating a delayed trigger. The product of the VoltSense and the CurSense is the power (they need scaling in software).

Also notice that the zero crossing detector 'misses' the actual zero crossing by about 600uS. This is due to the turn on/off of D5. This will have to be corrected in software as well.

Dimmer 2 - Circuit Test

I partially got my previous dimmer circuit working. I was able to get the CPU to power up, run programs and do transmit/receive via the radio. However, my circuit to measure the current through and the voltage across the load did not work. The Op-amps I selected did not have a high enough common mode voltage rejection ratio to prevent them from locking. To solve this problem, I have switched to the LM2902 which has six times the common mode voltage rejection ratio of the LMV356 used in the previous design.

Here is the current design.

Before I submit my layout for this circuit to the PCB manufacturer, I thought is wise to give it a try. Below are a couple pictures of the setup. The trick to this circuit, as mentioned above, is to use an Op-amp with high common mode rejection. Also, it is important to float the entire circuit to a common ground. In the real circuit, powered by the AC input, this is no problem. Everything is referenced to Neutral. On the bench, I was using my bench supply for the DC voltage supply and a separate AC voltage supply for the signal. To get them referenced to the same ground, I tied the DC ground to the Neutral of the AC voltage supply. Works great!

Setup. This is a picture of the current and voltage sensors. The virtual ground is also included. The three brown cylinders on the left are my dummy load (300 ohms, 50 Watts). The AC Live line comes in the top of the board on the green clip-cable and goes out the bottom of the board on the orange clip-cable. The signal goes through the dummy load and returns on the black clip-cable. At this point, the signal goes through the sense resistors (the large blue resistors in the middle fo the board - 2x .250 Ohm at 3W each). It then returns to the AC supply via the brown cable going out the top of the board.
Circuit. In this picture you can see the two sense resistors in series with the Neutral side of the AC supply. The bottom left Op-amp (pins 1 - 3) is the current sense circuit. The bottom right Op-amp (pins 5 - 7) is the voltage reference and the top left Op-amp is the voltage sense circuit.
Syndicate content