At 08:19 AM 6/15/2013, Spehro Pefhany wrote: >Hey, here's a really nice solution: > >http://www.dionics-usa.com/PDFs/DIG-12-15-30-DD.pdf > >Dual output with active discharge circuits* on each-- >100usec turn-off with a 1500pF load. Enough voltage >to drive HV MOSFETs. > >Not sure how easy to buy or at what price.. That's a *great* looking part and I'll be checking it out. Many=20 thanks for the suggestion -- even if I don't use it for this project,=20 its worth knowing about for future projects. My customer wants the load cut off right at the peak of the incoming=20 AC waveform. My standard circuit for doing AC peak detection is=20 quite unorthodox but it works very well - I've been using variations=20 on this theme since the '80s. Some background: a standard zero-crossing circuit detects when the AC=20 waveform is just crossing zero (a redundant statement, if there ever=20 was one, but necessary). The problem with just detecting=20 zero-crossing with a comparitor or even the back-to-back LED-based=20 opto-isolators mentioned in a couple of messages is that the AC=20 waveform in and about the zero-crossing point is often quite polluted=20 with all manner of noise and spikes. Back in the '80s, we used to make lighting dimmers for stage and=20 theatrical use. Small dimmers: 16 channels at 1.5KW per channel in a=20 3-RU rack enclosure. They really did work quite well - they had=20 single-cycle response current limit in the event of a shorted load=20 and *really* effective noise-filtering for the zero-cross=20 detection. We built only a few of these units (perhaps a dozen or=20 so) because the labor cost was just too high and most users were=20 willing to put up with replacing triacs or SCRs when they abused=20 their dimmers with shorted loads, as opposed to paying a bit more and=20 never having to replace a defective triac ever again. But I digress . . . I had been out of college for only a few years at that time and much=20 theory remained in my brain. Some of that theory came to very=20 practical use when trying to come up with an effective zero-crossing=20 detector. I actually built two, radically different, zero-crossing=20 detectors back in the '80s but I'll describe the first approach. One of the real problems with building zero-crossing detectors for=20 lighting dimmers is the aforementioned noise pollution in and around=20 the zero-crossing point. Much of that noise is caused by the lamp=20 pre-heat which keeps the lamp filaments warm so that they can respond=20 much more quickly without blowing up because of the surge-current=20 inrush that a cold tungsten filament requires. The standard approach to filtering impulse noise-spikes is to simply=20 filter them with a single-pole RC filter. This attenuates the spikes=20 quite nicely but introduces a phase shift. Then you have to=20 compensate for the phase shift using a monostable timer or such . . But some of that school theory remained in my brain and it got me to=20 thinking: What happens if you feed an AC waveform into a really-long=20 time-constant integrator? The result is a nice 90 degree phase=20 shift. As a bonus, all those nasty noise spikes on the incoming=20 waveform are nicely integrated as well - they simply aren't visible=20 on the scope. So: my zero-cross detector became a *very* simple circuit: incoming=20 120 Vac into a large-value resistor and a 100n capacitor (the=20 integrator), followed by a very simple slope detector made from one=20 op-amp section and another RC filter. The result was a perfect=20 square-wave who's rising and falling edges coincided perfectly with=20 incoming AC waveform zero-cross points. I used another op-amp=20 section and two RC differentiators with diode steering to generate=20 the actual zero-cross pulses which were then coupled to the dimmer=20 circuit via opto-isolators. Note that the leading edge of the=20 zero-cross pulse lines up exactly with the incoming AC zero-crossing=20 as opposed to the back-to-back LED opto-isolators mentioned in other=20 messages, where the actual zero-crossing is in the middle of the pulse. This circuit works really, *really* well and I've used it many times=20 between then and now. Fast-forward 30-odd years - now I need to do peak detection rather=20 than zero-cross detection. Same theory - a long integrator made from=20 a large-value resistor and 100n cap followed by a comparitor that=20 detects zero-crossing at the output of the integrator. Done . . . Some fiddly bits and pieces: I bias the integrator capacitor at half=20 the supply voltage so as to eliminate the need for a bipolar power=20 supply, then ensure that the comparitor (with hysteresis) switches=20 cleanly about that same bias point. Work the math out and you will=20 see that the bias voltage drops out of the equation. Use two 1/4W=20 resistors in series for the integrator so as to have adequate=20 high-voltage transient protection. Etc . . . dwayne --=20 Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax www.trinity-electronics.com Custom Electronics Design and Manufacturing --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .