[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Controlling Holiday Lights



On 31 Oct 2006 23:14:34 GMT, Dan Lanciani <ddl@danlan.*com> wrote:
> In article <slrnekfbic.bco.ZsdbUse1+noZs_0610@xxxxxxxxxxxxxxx>, ZsdbUse1+noZs_0610@xxxxxxxxxxxxxxxxxxxxx (sylvan butler) writes:
>| synth a 50% on-time, and know that with a 4% error limit I would be
>| close enough.  But again, that is power, not light.
>
> Power at 50% is fine, but can you describe the actual waveform that you
> would synthesize to trigger the triac?

For triac control I've been playing with small tables (a dozen or so
entries) which I output to the port sequentially, repeating from the
beginning every time the end is reached.  If alternating 1's and 0's in
equal numbers, then it results in a fairly good square wave to the triac
(a scope makes it pretty easy to see when task switches take away
control when running under linux, or an interrupt (eg keyboard) under
DOS).  Repeating a few 0's or a few 1's in unequal amounts just extends
the off time or on time, respectively, destroying the symmetry of the
square wave.

When I connect that to a "zero switching" solid-state relay, the light
has very few dim levels before it is visibly flickering.

When I use a "random switching" SSR, the behavior of the light is fine.

And of course, as expected, it works better to switch 1/0's more
frequently (faster bits per second output) rather than less frequently,
but more frequent switching does demand more CPU attention.

I've haven't tried any complex waveforms other than when experimenting
with single-bit audio output or LEDs (no triac involved).  Square waves
are a natural.  :)   With a small bit of capacitance and a resistor
(IIRC, I was using 0.1uf and 1k), I've also been able to synth OK
looking sine, saw and triangle waves.  Some of those required a lot more
than a dozen entries in the table, but could probably be optimized a
considerable amount.  Then for audio, I modified a version of the linux
pc speaker driver from ancient days.  It is able to reproduce
intelligible speech quality but that's where I left it.

sdb
--
Wanted:  Omnibook 800 & accessories, cheap, working or not
sdbuse1 on mailhost bigfoot.com


comp.home.automation Main Index | comp.home.automation Thread Index | comp.home.automation Home | Archives Home