zero cross

Thread Starter

Ron R

Joined Nov 21, 2009
7
Gentlemen:
I have a circuit problem I've been unable to solve:
I am using a switching power supply circuit to operate op amp circuits. I need an accurate zero cross detect of the incoming AC voltage from a "12VAC" wall transformer. In the attached circuit, if I use the voltage at "ACX" or "ACY", I see a distorted, clipped half-wave 'sine'. I tried an Opto-isolator across ACX and ACY, but it is too slow for an accurate zero cross. (I'm using a LM339 for the zero cross detect.) The only thing so far that works is to use a half-wave rectiifier (one diode) instead of the full-wave bridge. Then ACX shows a full sine when referenced to ground. (The LM339 needs the minus input grounded in single-supply mode.) How could I get some "isolated" sine referenced to system ground but still use a full-wave bridge?
Did I describe the situation well enough?
Thank you for any advice.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Your proposed circuit is not safe, as it does not isolate from mains power using a transformer. If the LM5010 fails shorted from input to output, mains power will be on the output of it. As things are, you are exceeding the absolute maximum input voltage of the LM5010 by about 100v.

The two 120uH inductors do not provide isolation protection.

You need to first fix that part of the circuit before further discussion on it can be entertained.
 

hgmjr

Joined Jan 28, 2005
9,027
Ron R said:
I need an accurate zero cross detect of the incoming AC voltage from a "12VAC" wall transformer.
Your proposed circuit is not safe, as it does not isolate from mains power using a transformer. If the LM5010 fails shorted from input to output, mains power will be on the output of it. As things are, you are exceeding the absolute maximum input voltage of the LM5010 by about 100v.

The two 120uH inductors do not provide isolation protection.

You need to first fix that part of the circuit before further discussion on it can be entertained.
sgtwookie,

If I understood the OP's initial post correctly, he is using an 12VAC wallwart to feed the input to his circuit. If that is the case, then the OP is observing due diligence with respect to safety in handling the connection to mains.

hgmjr
 

Thread Starter

Ron R

Joined Nov 21, 2009
7
Thank you for the interest in my question.
Yes, in my description of the situation, I state that the source of AC power is a 12VAC wall transformer.
And I hadn't noticed the diode drawn in reverse direction in the schematic. I am using the circuit presently with diodes in correctly.
The problem remains...
 

SgtWookie

Joined Jul 17, 2007
22,230
Sorry about that; I was tired when I first looked at your schematic, and missed the transformer part.

You're making your ground reference after the two 120uH inductors. The difference is occurring due to the voltage across the inductors; that's offsetting your comparator's ground reference from what the actual is.

I suppose what you could do is to use a resistive divider across your unregulated AC input as inputs to your comparator to find out when your actual zero crossing is.
 

SgtWookie

Joined Jul 17, 2007
22,230
In case you're wondering what I'm talking about, see the attached.

I left out your regulator and much of the filtering just to simplify things a bit.

R2 thru R4 are the voltage divider. The values really aren't critical, but you should keep the voltage ranges within the 339's rails. Some clamping diodes would be a good idea.
R5 is the mandatory output pull-up resistor for the 339.
R6 gives the comparator a bit of hysteresis, just to keep the zero crossing unambiguous.

You may want to use metal film resistors for lower noise, and perhaps a small cap (say, 10pF) across R3 to keep things quiet without inducing much phase shift.

[eta]
See the schematic in the next post; clamping diodes and noise-reduction cap have been added, as well as correcting the hysteresis feedback resistor connection as mentioned by Robert, two posts down.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Here's basically the same circuit with clamping diodes and a cap across R3. The clamps will protect the 339's inputs when the circuit is first powered up. Your existing Zener will protect against spikes as long as the bridge and Zener are intact.

Use Schottky diodes, like perhaps BAT54's, as they have a lower Vf than standard silicon diodes.
 

Attachments

Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Good catch, Robert - thanks.

Yes, it needs to be on the non-inverting input.
220k will give a hysteresis of about 36mV, which should be enough.
 
Top