Electronics > Projects, Designs, and Technical Stuff
Isolated zero cross detection w/ AC mains
iroc86:
Well, this thread has turned into quite a good discussion! :) ... CTR, noise, transients, etc. I appreciate seeing some practical examples--it really helps to delve into the nuances of these circuits instead of just focusing on a textbook/breadboard concept. The resistor chain variant you've all been discussing is rather interesting in its simplicity; I might look into that for my own application.
Ian.M, thanks for posting up your circuit and simulation. I reviewed the waveforms in LTspice and the output looks very good; a short duration pulse with a fast rising edge. The use of jellybean parts is also a plus. Would you mind explaining the circuit operation and filtering for us? Is this something you've used in another design, or did you whip it up just now?
I'd like to introduce another topic: safety and suppression. How might some of these designs better accommodate unexpected AC spikes or the wrong input voltage? MOVs, fuses...?
beduino:
--- Quote from: schmitt trigger on October 09, 2019, 12:23:37 am ---If you are using emitter resistors, then don’t use collector resistors. Or viceversa.
--- End quote ---
I use emiter resistor since it is connected to MPU input pin and with optocoupler turned off pulls this pin to GND.
When optocoupler is turned on we have voltage divider with lower collector resistor and additional emiter voltage drop something like this:
--- Quote from: schmitt trigger on October 09, 2019, 12:23:37 am ---100k is way too large an optocoupler load resistor, go for 10k or 5k.
--- End quote ---
I've changed emiter resistor 100k to 10k and collector resistor to 1k and now logic high is 9.4ms, 1ms shorter than logic low 10.6ms on 230VAC 50Hz mains 8)
Now, logic high periods are shorter (~1ms) than logic low and this what I've expected to see on logic analyser, since there must be some delays in optocoupler output.
I will try also much faster 6N137 optocoupler :-/O
Ian.M:
@Iroc86,
I knocked up the sim on the spot just for you. There's another common high pulse current, low quiescent current ZC opto driver circuit that inspired me: https://www.edn.com/design/analog/4368740/Mains-driven-zero-crossing-detector-uses-only-a-few-high-voltage-parts
(which is very similar to the web archive dextrel.net one eliocor posted back in reply #21, but IMHO better thought out).
I decided it needed to be unipolar so you could guarantee to switch on the transformer on the opposite polarity half cycle to the one it was last switched off, and I wanted a snap action for a really sharp leading edge, which meant it needed a SCR or UJT. After some playing around in LTspice, I replaced the SCR with one built from jellybean BJTs, added HF spike filtering on the input and got rid of a lot of extra parts.
R1A should be a high voltage type, as due to the filter cap C2 behind it, it is severely stressed by fast HV transients. If you are using ordinary 200V resistors, 2x 160K would be advisable. C2 should be a 1KV or greater HV cap. R1B, R1C and C3 are less stressed, but if you anticipate really bad transients, keeping the same spec as R1A, C2 may be advisable. Everything to the right of R1C is protected by it limiting the available current, and by D3 clamping the peak voltage. Even continuous applied DC at the peak line voltage wont cause any damage (or cause any output pulses). N.B. the circuit may false trigger during the positive half cycle on longer large negative going transients. The sim has both positive and negative 2us long 1KV peak triangular transients added to the AC sinewave, and no objectionable false triggering was observed.
It tolerates a wide input voltage range e.g. 150V - 300V RMS only causes a 5% change in opto LEDdrive current, and a 70us shift of the leading edge, which is only a 1.25 degree change in firing angle, or 0.7% of a half cycle.
However it doesn't do line voltage or frequency monitoring. If you need that, a low pin count PIC MCU with a ZCD peripheral and an ADC input is probably your best bet, powered by a capacitive dropper supply, and driving two OPTOs, one for 'Line Good' (i.e. in valid range for voltage and frequency) and the other for a squarewave synchronised to the ZC, so you get both rising and falling ZC events and can discriminate between them.
I may build up my simmed circuit and test it as I have a *VERY* long duration timekeeping application that would benefit from PLLing its timebase to the mains supply. I'm looking for something like 1ppm/year max drift, but don't have a sky view for a GPS. However I'm more likely to go for a linear PSU and taping the secondary side AC for timekeeping as that lets me use an off-the-shelf AC output wallwart.
beduino:
--- Quote from: floobydust on October 05, 2019, 05:41:18 am ---You need an even number of 1/2 cycles so the big transformer core does not saturate and many examples (fig.3a) show it's best to switch in on the AC peak, not at zero cross, to have lowest inrush current by exploiting the transformer's inductance.
--- End quote ---
So, depending on application maybe we do not need very accurate zero crossing eg. in the case of switching on iron core spot welder transformer, since we are very close to AC mains voltage peak (flat) maximum based on mentioned article:
https://sound-au.com/articles/inrush.htm
--- Quote ---In some cases, it's best to apply power when the mains is at its maximum value (peak of RMS =Top nominal voltage × 1.414), and with others it's far better to apply power as the AC waveform passes through zero volts. Iron core transformers are at their best behaviour when the mains is switched on at the peak of the waveform, while electronic loads (rectifier followed by a filter
capacitor for example) prefer to be switched on when the AC waveform is at zero volts.
--- End quote ---
Isn't it will depend on needed welding power accuracy, how accurate zero crossing or voltage peak maximum timing needed in given design?
iroc86:
--- Quote from: Ian.M on October 09, 2019, 10:35:54 am ---I knocked up the sim on the spot just for you.
--- End quote ---
Aw, thanks so much! I'm going to play around with the circuit in LTspice some more. Might have a few more questions for you. I'm in the US, so I'd like to try out some different filtering scenarios for 120 VAC / 60 Hz operation. If I were to add an isolation transformer on the front end, I presume I could just tweak the input resistors and filters to maintain the same level of triggering as per the mains-voltage version? (Ignoring any phase shift of the transformer, at least for the purposes of simulation...)
Using this circuit for your long-duration timekeeping application sounds pretty neat. I can see how this'd be one way of reliably locking onto the mains frequency.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version