Sunday, 8 March 2009

dimmer results

(click on the picture to view in full size)
I had to do a little bit of tuning at first with respect to the timings but at the end I had a very good working dimmer. The only pain in the ass was the CAB signal send by the net distributor. This signal comes when traffic lights or day/night tariff needs to switch on/off. In the case of Belgium and in my area this is 1347Hz. Although this is only 5% of the nominal 230V supply this causes heavy flickering. This was definitely something I didn't want in my final design. On the picture at the left you can see the error of the opto coupler. I noticed that this can be as far as -400µs + 400µs. Of course this phenomenon lets it
self see without a doubt. So I had to search for a solution. I first thought about simply putting an analogue filter network but this cause to many phase shifts and is difficult to get stable if you must go to 10 order and more. Yes this thing kept me going for about 3 mounts believe me. Second approach was putting a highly optimized crystal ( 0.3 ppm ) I tried to synch not on the zero cross but only on that crystal. Again this was a no go. The frequency of the net can vary between 49.8 - 50.2 in a few 10 seconds depending on area. So my crystal was far to secure to do the synchronisation. The lamp faded away and came back on again in about 10 to 20 seconds. I did a lot of try outs in software with partial synchronisation but still the flickering was there. After all that bad news, I started to read documents that told something about this topic. Lots of them. I even contacted a professor at the university of Idaho. He sent me a paper on optimizing a zero crossing. It was based on a PLL approach. I study the document but it had to many questions to even thinking on implementing it. But it gave me some new relief and hope. In between my searches I saw a lot about DSP processors. These things are very powerful especially for digital filtering. One disadvantage : those things are very expensive to buy in the form of a development kit. Meanwhile I had my focus now on trying to digitally filter the 1347Hz. Coincidently I just started to learn the python language and I saw in one of the libraries the plot.py. I started to experiment and wrote a program based on my theoretical point of view. I soon found out that indeed it could be done using a digital FIR ( Finite impulse response ). On the third picture you can see my simulation in plot python. So i artificiality generated the sin wave of 50hz + 1347HZ as the source signal. I calculated the factors using a helper program as java applet and can be found :

http://www.dsptutor.freeuk.com/FIRFilterDesign/FIRFilterDesign.html

I did a lot of testing with several number of taps and sampling rates. But at least I was very sure that this must be feasible. There was just one question to answer : which processor can handle these calculation and is also cheap enough to afford ?

Be my guest in my next blog that will be fully dedicated on this topic.

No comments: