Advice on zero-cross detector with hysteresis

Thread Starter

ra5040

Joined Sep 26, 2018
42
hi ebp,
That looks better.
Hi Eric,
Thanks for the circuit. It's certainly much simpler and gives a proper zero-cross. The problem for me though is 1) I need a bit of processing time after the 'nearly zero-cross', so it's better if the detection is above zero, 2) your circuit would give the full -23V at the -IN.

So I think it will have to be something like the attached. I'm sure the resistor values could be better (I'm flying by the seat of my pants here!). All the currents will be in the uAs ... could that make the circuit more susceptible to noise?

For the ESP32: high & low edges and also high and low levels for interrrupts. (It's a very nice chip!).
 

Attachments

Thread Starter

ra5040

Joined Sep 26, 2018
42
The bridge would need a loading resistor to be sure the output [edit - output of bridge, that is is] was pulled to zero.
Thanks for pointing that out. I took out the voltage divider and of course the circuit stopped working as the output of the rectifier went to around 5V. So the attached circuit is probably as paired down as possible for 'a-bit-before-zero-cross' and a bridge, would you agree?

 

Attachments

ericgibbs

Joined Jan 29, 2010
21,460
hi ra,
You can create a little trigger advance on the zero detect point, if you use a small bypass cap on the 30k.
Use the falling edge interrupt.
E
AA1 17-Oct-18 15.05.gif
 

ebp

Joined Feb 8, 2018
2,332
Be careful with putting a phase lead cap in the attenuator since that may make the circuit more sensitive to high frequency noise.

When simulating circuits like this it is useful to add a noise source (noise, as such, if available as a source, otherwise some convenient standard waveform; you can even add two or three different ones in series) in series with the input source.

Filtering the input can sometimes be useful, but of course a low pass filter will introduce phase lag. Adding phase lead after the filter is safer than with no filter.

If a circuit like this is ultimately used to control something like SCR firing (e.g. for a half controlled bridge rectifier), everything related to phasing becomes an issue, depending on how the SCRs are fired. You can get into issues of firing on the wrong half cycle altogether, or firing when you think you are at the end of the half cycle you want to control when you are actually into the beginning of the next half cycle.
 

Thread Starter

ra5040

Joined Sep 26, 2018
42
Be careful with putting a phase lead cap in the attenuator since that may make the circuit more sensitive to high frequency noise.

When simulating circuits like this it is useful to add a noise source (noise, as such, if available as a source, otherwise some convenient standard waveform; you can even add two or three different ones in series) in series with the input source.

Filtering the input can sometimes be useful, but of course a low pass filter will introduce phase lag. Adding phase lead after the filter is safer than with no filter.

If a circuit like this is ultimately used to control something like SCR firing (e.g. for a half controlled bridge rectifier), everything related to phasing becomes an issue, depending on how the SCRs are fired. You can get into issues of firing on the wrong half cycle altogether, or firing when you think you are at the end of the half cycle you want to control when you are actually into the beginning of the next half cycle.
Yes, the circuit will be used to fire a triac. I have tested the simulation with noise ... see attached LTSpice .asc. And here's a plot:



The rest of the circuit looks like this:


So the timing is down to software. I'm trying to keep it as simple as possible as this isn't an area that I'm at all comfortable in!
 

Attachments

tindel

Joined Sep 16, 2012
939
If a circuit like this is ultimately used to control something like SCR firing (e.g. for a half controlled bridge rectifier), everything related to phasing becomes an issue, depending on how the SCRs are fired. You can get into issues of firing on the wrong half cycle altogether, or firing when you think you are at the end of the half cycle you want to control when you are actually into the beginning of the next half cycle.
Don't forget that temperature of the parts (particularly any caps you use) also play a part and can shift your phase lead/lag as well. This is not a trivial thing. Especially if you need to operate over a large temp range.
 
Top