PWM isn't applicable to AC; for dimming AC lights, you use "phase
control:"
http://www.google.com/search?hl=en&source=hp&q=%22phase+control%22
(OK, admittedly, at least one of these sources compares phase control
to "AC PWM," but I've never used the terms interchangeably.)
Hope This Helps!
Rich
>Anti-Spam wrote:
>
>> I am designing a mains voltage light show controller, for controlling
>> 40 channels of lights. Need some advice please.
>> I am programming in PicBasic using the IC2 and the PWM routines.
>> The PIC I will use will have a IC2 port.
>> My question is, will the PWM function work for dimming the lights?
>
>PWM isn't applicable to AC; for dimming AC lights, you use "phase
>control:"
>http://www.google.com/search?hl=en&source=hp&q=%22phase+control%22
You use a zero crossing detector and sync the pwm period to the mains
half cycle. It'll work well enough for jazz.
Which PIC has an IC2 port ???
hamilton
Is IC2 better than I2C?
I can add a Zero Crossing Detector, reasonably easily. Scrub using PWM
and do my own timing to trigger the Triacs.
Because the MOC3020 (as I understand it) has a zero crossing detector
buit in, I assume I will have to use a different device without ZCD?
But will the time it takes for the PIC to issue a IC2 command, and for
its content to hit the output port of the PCF8574, not be a problem?
I thought many of them have???
OK, show me at lest one.
hamilton
>On 3/11/2011 11:23 AM, Anti-Spam wrote:
>> On Fri, 11 Mar 2011 06:39:43 -0700, hamilton<hami...@nothere.com>
>> wrote:
>>
>>> On 3/11/2011 12:55 AM, Anti-Spam wrote:
>>>> I am designing a mains voltage light show controller, for controlling
>>>> 40 channels of lights. Need some advice please.
>>>> I am programming in PicBasic using the IC2 and the PWM routines.
>>>> The PIC I will use will have a IC2 port.
>>>> My question is, will the PWM function work for dimming the lights?
>>>
>>> Which PIC has an IC2 port ???
>>>
>>> hamilton
>>
>> I thought many of them have???
>
>OK, show me at lest one.
>
>hamilton
Sorry, I got the terminology wrong, feel better?
Thats is an opto-triac, and once on, it will stay on for the rest of the period.
So, no.
You need to find the zero crossing and then count until you fire the triac.
Very basicaly the PWM will only work if your lights runs from a DC source,
and you drive them with a MOSFET or transistor of sorts.
So how about driving a MOSFET inside a bridge, to control AC lights then?
Grant.
That will work, but you may get aliasing between the PWM and the mains frequency,
I had a similar aliasing problem using 3 independent PWM generators for RGB,
and fixed it by using a common clock for 3 PICs.
http://www.panteltje.com/panteltje/pic/ethernet_color_pic/
So if you want to do that, then you may need to lock your clock with a PLL to the mains.
Quite possibly, I remember a sound to light project I made as a teenager
that aliased bass notes with the mains frequency to create a flashing light
instead of the expected steady light. It was three bandpass filters feeding
three TRIACs for lo, mid and hi frequencies (musicolour, an EA magazine kit
from early 1970s).
I've seen an SCR used inside a bridge, but not a MOSFET. At least putting the
switch inside a bridge means you're not running high voltage DC around the
lighting fixtures and stuff not rated to quench a DC arc.
Grant.
you can do that, I've seen it done on reverse phase angle dimmers,
i.e. instead of turning on
during cycle and off at zero crossing, it is turned on at zero and off
during the cycle.
I guess you could do "real" pwm too
also seen back to back nfets used as a switch for mains
with a fet you can get quick turn off so if you measure the current
and add that to the control
you could make it pretty much short circuit prof
-Lasse
That sounds like a big plus :) An idea for later, at the moment I'm doing
low voltage LED lighting, although a recent prototype runs >100V to 50 LEDs
in a series string. Powered from 12 or 24V DC.
Grant.
>
>-Lasse
Before i read any others posts; i suppose you could do it that way. You
would have to have 40 PWM outputs though (one per channel). Plus some way
to synchronize them with the mains, otherwise the triacs would effectively
be firing randomly.
Bluntly, the triacs are PWM outputs, with mains timed start pulses and off
at the end of every half-cycle.
Forty channels, across phases too? Take care synching to the correct phase ;)
Grant.
OK, did not really think the Dimming problem through. So have decided
not to use the PCF8574, and use a PIC in its place. In fact will drop
I2C altogether in favour of Serial Comms, and use a PIC with a UART
port instead. Will also drop the MOC3020, for a opto/triac isolator,
with no Zero Crossing detector. Will do my own zero crossing
detection, with a opto isolator, going back to the PIC.
I am thinking on the lines of having 5 slave boards (each having 8
lamp output channels), each slave having its own unique address (set
by DIP switches), but all the SERIN inputs of the 5 slaves, wired in
parallel.
I read somewhere that a PIC UART can only hold 2 bytes of data, so the
Master controller board would send 2 Bytes of data, for each lamp it
wants to control. The 1st byte would would contain the address of the
board/lamp it wants to switch and the 2nd byte stating how long the
fade up/down time should be, for that lamp.
Am I now thinking on the rights lines?
I suggest that you start with mains synchronization. Required just make a
dimmer produce consistent results. Then worry about many channels. Then
the fancies.