Author Topic: Hey, actually figured something out on my own! (zero-crossing detector)  (Read 2790 times)

0 Members and 1 Guest are viewing this topic.

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Last night laying in bed I thought, for some strange reason, about how would a guy implement a zero-crossing detector? Odd, since I have no current use for such a thing, but an interesting intellectual exercise nonetheless.

I first thought, as I always do, how would a guy do this using only discretes? Diodes, BJTs, stuff like that.
Couldn't think of how that could possibly be done.
Then it struck me: how 'bout an op-amp a comparator? So I came up with the following scheme:



Now this is totally bare-bones, just a basic proof of concept thing.
This morning at breakfast I cracked open my copy of Horowitz & Hill (The Art of Electronics), looked up "zero-crossing" in the index and found this:



So hey, maybe I'm not as dumb as I think (or as others might accuse me of being). Now of course this is a fully-fleshed-out circuit, just about ready for use, with input protection (and hysteresis!).

I put that inverter after the op-amp because I figured that the output was going to be low, not high, on a zero crossing, but H&H, those clever dogs, just used the inverting configuration of the amp. Doh!

Anyhow, it gave me a slight boost this am. Now if I can just find a project that needs this thing ...
 
The following users thanked this post: BILLPOD

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 2132
  • Country: is
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #1 on: December 23, 2024, 02:34:39 pm »
These were used in older 60Hz digital clocks but line noise caused 'extra' clocking. I have even seen some low grade audio frequency counters that used the line frequency as the time base, in fact I owned an old Heathkit D.M.M. who's accuracy depended on line frequency! That D.M.M. was useless in our mobile broadcast studio when running on generator!
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #2 on: December 23, 2024, 02:52:17 pm »
Quote
I put that inverter after the op-amp because I figured that the output was going to be low, not high, on a zero crossing,
Output will be both a low and high on zero crossing, so inverting doesn't matter.
This circuit doesn't generate pulses on zero crossing, it produces edges (both positive and negative) on zero crossing. So to obtain classic zero crossing detector you need to add edge detection circuit on output (it could be one XOR element + RC network)
 
The following users thanked this post: tooki

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13069
  • Country: ch
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #3 on: December 23, 2024, 05:15:18 pm »
These were used in older 60Hz digital clocks but line noise caused 'extra' clocking. I have even seen some low grade audio frequency counters that used the line frequency as the time base, in fact I owned an old Heathkit D.M.M. who's accuracy depended on line frequency! That D.M.M. was useless in our mobile broadcast studio when running on generator!
Mains-clocked clocks are still super common in appliances (like ovens). Perhaps modern implementations use a bandpass filter to reduce spurious clocking?
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #4 on: December 23, 2024, 08:38:56 pm »
Quote
I put that inverter after the op-amp because I figured that the output was going to be low, not high, on a zero crossing,
Output will be both a low and high on zero crossing, so inverting doesn't matter.
This circuit doesn't generate pulses on zero crossing, it produces edges (both positive and negative) on zero crossing. So to obtain classic zero crossing detector you need to add edge detection circuit on output (it could be one XOR element + RC network)

By "this circuit" you mean my dreamt-up one, not the H&H one, right?
I assume theirs produces pulses.
Still learning here.
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #5 on: December 23, 2024, 10:12:55 pm »
Both
 

Offline SteveThackery

  • Frequent Contributor
  • **
  • Posts: 759
  • Country: gb
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #6 on: December 24, 2024, 09:11:03 am »
I don't understand. Referring to the original "bare bones" circuit, why doesn't it just convert the sine wave to a square wave? Where do the pulses come from?
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13069
  • Country: ch
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #7 on: December 24, 2024, 10:13:38 am »
Quote
I put that inverter after the op-amp because I figured that the output was going to be low, not high, on a zero crossing,
Output will be both a low and high on zero crossing, so inverting doesn't matter.
This circuit doesn't generate pulses on zero crossing, it produces edges (both positive and negative) on zero crossing. So to obtain classic zero crossing detector you need to add edge detection circuit on output (it could be one XOR element + RC network)

By "this circuit" you mean my dreamt-up one, not the H&H one, right?
I assume theirs produces pulses.
Still learning here.
Take a look at the waveforms in these crude sketches of mine, attached. The first one is what you mistakenly think a comparator circuit would output. But in actuality you get the second one. In the second one, I have added arrows to the edges so you really see what xvr meant about edges (rising and falling) and how you get both highs and lows at zero crossings.
 

Offline StrayElectrons

  • Contributor
  • Posts: 19
  • Country: ca
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #8 on: December 24, 2024, 10:29:50 pm »
ZVS (zero voltage crossing) was used on the RCA CTC-203 SMPS.    Only I think 2 transistors, 431 and MOSFET, this circuit is self oscillating.

It doesn't have op-amp at all.

Cheers,
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #9 on: December 24, 2024, 11:12:03 pm »
I don't understand. Referring to the original "bare bones" circuit, why doesn't it just convert the sine wave to a square wave? Where do the pulses come from?

First of all, thanks for paying attention here.
Answer: they don't.
Feel like I've got a little egg on my face here.
So my attempt was obviously a shot in the dark that missed its mark.
But the Horowitz & Hill circuit? I assumed that it would work as advertised.
Guess what? It doesn't.
I simmed it in LTSpice. Was careful to make the circuit exactly as in the book, except for the comparator: I don't have a model for the LM393, so I used a LT part (LT1720) that should work the same: it's a single-supply (3.3-5V) rail-to-rail device.



Here's the output, just like someone said above: just a square wave:



I'm really surprised that this comes from the esteemed H&H. Is there an error in their circuit? Will it only work with an LM393? What's going on here?

I've attached the .asc file in case someone wants to play around with this (and you can check my rendition for errors).
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #10 on: December 24, 2024, 11:27:16 pm »
ZVS (zero voltage crossing) was used on the RCA CTC-203 SMPS.    Only I think 2 transistors, 431 and MOSFET, this circuit is self oscillating.

Could you possibly provide that circuit, or help me find it? Definitely interested in anything that uses discretes.
Although that doesn't sound like a zero crossing detector so much as an oscillator that has something to do with zero crossing.
 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 3199
  • Country: gb
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #11 on: December 24, 2024, 11:42:52 pm »
A good source for ole skool  zero-crossing  circuits is the disco lighting controller circuits published by  the hobby mags ,one to get you started https://www.worldradiohistory.com/UK/Everyday-Electronics/90s/Everyday-Electronics-1990-01-S-OCR.pdf
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13069
  • Country: ch
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #12 on: December 24, 2024, 11:48:46 pm »
I'm really surprised that this comes from the esteemed H&H. Is there an error in their circuit? Will it only work with an LM393? What's going on here?
Why do you think it’s an error? It’s doing precisely what one would expect the circuit to do. Comparators compare, they aren’t timers.
For use with an MCU, no further circuitry is needed — an MCU can easily be programmed to react to edges instead of levels. (In fact, it is often beneficial to do so even in situations where levels could also be used.)

For circuits that aren’t MCU-based, there are ways to generate pulses from that.
 

Offline antenna

  • Frequent Contributor
  • **
  • Posts: 410
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #13 on: December 25, 2024, 12:08:16 am »
What about a schmidt trigger (for hysteresis), bias the input using a regulated DC source through a potentiometer, then AC couple the signal to the pot wiper and to the schmidt trigger input.  The pot would control the bias and therefore the crossing point making it easy to set to zero, and then if the output needs to be a different duty cycle, use the rising edge of the output to trigger a 555 or something else.
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #14 on: December 25, 2024, 12:26:38 am »
I'm really surprised that this comes from the esteemed H&H. Is there an error in their circuit? Will it only work with an LM393? What's going on here?
Why do you think it’s an error? It’s doing precisely what one would expect the circuit to do. Comparators compare, they aren’t timers.

My bad, I guess. Yes, I know what comparators do, but I had assumed (hoped?) that the output would be tailored to create a pulse instead of just squaring the wave.

Shoulda paid more attention to H&H's description:
Quote
The circuit shown in Figure 3.68 generates an output square wave for use with TTL logic (zero to +5V range) ...

And that it does, very well.

I'm looking at that Everyday Electronics article now.
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #15 on: December 25, 2024, 12:27:30 am »
What about a schmidt trigger

Schmitt trigger.
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1653
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #16 on: December 25, 2024, 02:55:05 am »
Last night laying in bed I thought, for some strange reason, about how would a guy implement a zero-crossing detector? Odd, since I have no current use for such a thing, but an interesting intellectual exercise nonetheless.

I first thought, as I always do, how would a guy do this using only discretes? Diodes, BJTs, stuff like that.
Couldn't think of how that could possibly be done.
Then it struck me: how 'bout an op-amp a comparator? So I came up with the following scheme:

(Attachment Link)

Now this is totally bare-bones, just a basic proof of concept thing.
This morning at breakfast I cracked open my copy of Horowitz & Hill (The Art of Electronics), looked up "zero-crossing" in the index and found this:

(Attachment Link)

So hey, maybe I'm not as dumb as I think (or as others might accuse me of being). Now of course this is a fully-fleshed-out circuit, just about ready for use, with input protection (and hysteresis!).

I put that inverter after the op-amp because I figured that the output was going to be low, not high, on a zero crossing, but H&H, those clever dogs, just used the inverting configuration of the amp. Doh!

Anyhow, it gave me a slight boost this am. Now if I can just find a project that needs this thing ...

Here's a commercial example...
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #17 on: December 25, 2024, 03:23:00 am »
A good source for ole skool  zero-crossing  circuits is the disco lighting controller circuits published by  the hobby mags ,one to get you started https://www.worldradiohistory.com/UK/Everyday-Electronics/90s/Everyday-Electronics-1990-01-S-OCR.pdf

Thanks. I looked at that. Extracted the following circuit fragment from it:



Does a pretty damn good job of what H&H's circuit above does:



Now, if a guy wanted to turn that output into short pulses--one pulse per zero crossing--how would he go about doing that?
Thinking of playing around with gates: flip-flop?
We want a pulse on each zero crossing. Like what @Tooki drew:

« Last Edit: December 25, 2024, 03:29:39 am by Analog Kid »
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #18 on: December 25, 2024, 09:42:53 am »
Quote
Now, if a guy wanted to turn that output into short pulses--one pulse per zero crossing--how would he go about doing that?
2469699-0

IC is 1/4 of 74HC86 or 1/4 of CD4070 or 74LVC1G86
 

Offline SteveThackery

  • Frequent Contributor
  • **
  • Posts: 759
  • Country: gb
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #19 on: December 25, 2024, 10:09:13 am »
Quote
Now, if a guy wanted to turn that output into short pulses--one pulse per zero crossing--how would he go about doing that?
(Attachment Link)

IC is 1/4 of 74HC86 or 1/4 of CD4070 or 74LVC1G86

Do we need a diode across R8 to help discharge the capacitor? Actually, no, I can see that it's unnecessary provided the capacitor is small enough to produce a pulse which is very short compared with the sine wave period.
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #20 on: December 25, 2024, 10:58:31 am »
Quote
Do we need a diode across R8 to help discharge the capacitor?
Definitely no. Diode across R8 will shrink pulse width for negative edge. Circuit should be symmetrical for both edges, so diode SHOULD NOT be used.
 
The following users thanked this post: SteveThackery

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13069
  • Country: ch
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #21 on: December 25, 2024, 11:16:39 am »
I'm really surprised that this comes from the esteemed H&H. Is there an error in their circuit? Will it only work with an LM393? What's going on here?
Why do you think it’s an error? It’s doing precisely what one would expect the circuit to do. Comparators compare, they aren’t timers.

My bad, I guess. Yes, I know what comparators do, but I had assumed (hoped?) that the output would be tailored to create a pulse instead of just squaring the wave.
There well may exist a chip designed to do just that, but it wouldn’t be sold as a general-purpose comparator. A comparator’s job is to compare. Doing other things falls outside its purview, and besides, would need other components to configure it. (E.g. how long is the pulse? For 50/60Hz mains, where you’d get pulses at 100/120Hz, a pulse length of 5ms is no problem. But at the 400Hz used for aircraft systems, 5ms is longer than the entire period. Never mind at higher frequencies. So you would need a configurable pulse length.)

I checked, and zero-crossing detector (ZCD) ICs do exist, but every one I found outputs a square wave like the comparator.

Given that zero-crossing detection is also used for things like phase measurement, where you need to distinguish between the rising and falling zero-crossings, it seems reasonable to me that ZCD circuits and ICs don’t default to making pulses, since pulses are less flexible, and pulses can be created from the square wave, but phase-accurate square waves cannot be reconstructed from the pulses.

We want a pulse on each zero crossing. Like what @Tooki drew:

(Attachment Link)
Why do we want that? What is an application where we need two pulses per period and cannot accomplish the same thing with the square wave?
 

Offline antenna

  • Frequent Contributor
  • **
  • Posts: 410
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #22 on: December 26, 2024, 12:11:55 am »
What about a schmidt trigger

Schmitt trigger.
I got the spelling from Schmidt beer, honest mistake for a Minnesotan
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 8881
  • Country: us
  • Retired, now restoring antique test equipment
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #23 on: December 26, 2024, 12:13:25 am »
What about a schmidt trigger

Schmitt trigger.
I got the spelling from Schmidt beer, honest mistake for a Minnesotan

The beer that grew with the great north-west!
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #24 on: December 26, 2024, 12:22:35 am »
Nah, it's Grain Belt for me.
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 8881
  • Country: us
  • Retired, now restoring antique test equipment
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #25 on: December 26, 2024, 12:23:56 am »
I miss the animated Hamm's bear.
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #26 on: December 26, 2024, 12:25:21 am »
We want a pulse on each zero crossing. Like what @Tooki drew:

(Attachment Link)
Why do we want that? What is an application where we need two pulses per period and cannot accomplish the same thing with the square wave?

I don't know.
I had a project in mind that needed this, can't think of it now.
Why don't y'all just humor me, consider this an interesting electronic challenge.
How could a guy generate short-ish pulses from that nice square wave at each zero crossing?
Surely you smart guys can come up with something.
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #27 on: December 26, 2024, 12:27:26 am »
I miss the animated Hamm's bear.

[Indian drums: BOOM boom boom boom BOOM boom boom boom]

From the land of sky blue waters,
From the land of pines, lofty balsams,
Comes the beer refreshing—Hamm's, the beer refreshing.
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 8881
  • Country: us
  • Retired, now restoring antique test equipment
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #28 on: December 26, 2024, 12:31:03 am »
My favorite ad from that era has the bear playing hockey goalie and flirting with a cute lady beaver in the stands.
Her bratty kid-brother beaver chews a puck-clearing hole in his goalie stick.
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #29 on: December 26, 2024, 12:38:46 am »
Apparently that beaver also owns a chainsaw:

 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3351
  • Country: au
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #30 on: December 26, 2024, 04:48:35 am »
Here’s one I cooked up many years ago. Used it quite successfully in SCR soft starters for three-phase induction motors.
 
The following users thanked this post: Xena E

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
 
The following users thanked this post: tooki, Xena E

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20250
  • Country: gb
  • 0999
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #32 on: December 26, 2024, 07:17:38 pm »
That's only halfwave. Here's a fullwave solution, which is designed to work from a bridge rectifier.


EDIT: I attached the wrong .asc file. Here's the correct one.
« Last Edit: December 26, 2024, 10:28:28 pm by Zero999 »
 
The following users thanked this post: Analog Kid

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1049
  • Country: es
    • Picuino web
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #33 on: December 26, 2024, 07:36:18 pm »
Very precise and robust detector from: http://web.archive.org/web/20170704120431/www.dextrel.net/diyzerocrosser.htm



FEATURES:
    highly accurate mains zero crossing detection
    fully isolated and low voltage safe output
    ultra-low power consumption; worst case power dissipation < 120mW
    produces symmetrical pulses around zero crossings
    output pulse stays constant, independent of the mains voltage
    very low parts count, no precision components required
    all components can be low voltage SMD
    works over all voltage ranges (100VAC/240VAC), without modification
    50Hz/60Hz compatible
    50Hz produces a 1ms ZC pulse, 60Hz produces 0.83ms ZC pulse
    highly stable with varying temperature and aging
« Last Edit: December 26, 2024, 07:41:50 pm by Picuino »
 
The following users thanked this post: cte, Xena E

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1049
  • Country: es
    • Picuino web
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #34 on: December 26, 2024, 07:41:10 pm »
The only drawback I find to this circuit is that it is necessary to count only the even pulses (or odd pulses) to accurately measure the network frequency, because the time from an even pulse to an odd pulse is not the same as from an odd pulse to an even pulse.
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #35 on: December 26, 2024, 07:45:37 pm »
That's only halfwave. Here's a fullwave solution, which is designed to work from a bridge rectifier.

I loves it. Thanks!

Same old story here: I post a question, get a few answers, then the naysayers come out at night, accusing me of being a troll (!?!?!) but posting nothing of use.

Then someone posts a simple and elegant solution to my question. Which proves my theory that there are indeed people who not only know more than I do about electronics here, but who are willing to share their knowledge without condescension, carping or chiding.

Good job, @Zero999!
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #36 on: December 26, 2024, 07:53:28 pm »
> but posting nothing of use.

I give up. Why you ask a question when don't want to see an answer?
 
The following users thanked this post: tooki

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #37 on: December 26, 2024, 08:04:31 pm »
> but posting nothing of use.

I give up. Why you ask a question when don't want to see an answer?

Au contraire, mon ami.
I did want an answer, and I got it from comrade @Zero999.
OK?

What I don't want is a rash of shit saying "why bother asking that question?" or "what, are you nuts?" or things along those lines.
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #38 on: December 26, 2024, 08:20:16 pm »
You got 3 answers in total, but ignore 2 of them
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #39 on: December 26, 2024, 08:23:12 pm »
You got 3 answers in total, but ignore 2 of them

That's because I only got one that provided the solution I asked for (pulses on all zero crossings).
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #40 on: December 26, 2024, 08:25:17 pm »
Once again - you got 3 answers for your question - pulses on each edge of conparator output. And ignore (or didn't understand) 2 of them
 
The following users thanked this post: tooki

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #41 on: December 26, 2024, 08:35:36 pm »
Once again - you got 3 answers for your question - pulses on each edge of conparator output. And ignore (or didn't understand) 2 of them

To be fair, @Circlotron did post such a solution, but it looked a bit too complex for my taste (4 op-amps!).
We are allowed to pick and choose which solutions we like, yes?
Or are now subject to CCP rules that mandate that we accept all solutions equally?
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: ie
    • LinkedIn
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #42 on: December 26, 2024, 08:48:42 pm »
Post #19 and post #35 was ignored. Yes, you have a right take in account or ignore any solution on your choise, but don't be surprised to be taken as a troll in this case.
 
The following users thanked this post: tooki

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #43 on: December 26, 2024, 09:05:08 pm »
I'm trying to simulate #19 in LTSpice. Unfortunately, can't seem to do it, as for some reason the program doesn't recognize some of its own models (trying to use CD4030 or CD4070, since I don't have any of the 74HCT models).
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20250
  • Country: gb
  • 0999
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #44 on: December 26, 2024, 10:27:35 pm »
That's only halfwave. Here's a fullwave solution, which is designed to work from a bridge rectifier.

I loves it. Thanks!

Same old story here: I post a question, get a few answers, then the naysayers come out at night, accusing me of being a troll (!?!?!) but posting nothing of use.

Then someone posts a simple and elegant solution to my question. Which proves my theory that there are indeed people who not only know more than I do about electronics here, but who are willing to share their knowledge without condescension, carping or chiding.

Good job, @Zero999!

This was suggested in post 8, all due respect to zero999

Just stuff the output of a bridge rectifier into the AoE design and you have what you asked for.

There have been several other perfectly sound suggestions all ignored.

If you want to discuss a topic, do so, but FFS stop weaving a bullshit story into it and keep dismissing those who try to help, making pedantic comments about their answers, spelling, prose and wasting their time.

You are a troll, just not a very clever one.
I was a little puzzled about why he preferred my design over the others. It's nothing special. Plenty of other sensible suggestions have been posted. My design has its downsides, the main one being that it isn't isolated, but that wasn't a requirement. I just wanted something which will work with a bridge rectifier and doesn't require an additional diode in series with the load, so the zero crossing circuit is isolated with the smoothing capacitor.

Perhaps it's because I included a clear simulation and plot?
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1653
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #45 on: December 26, 2024, 11:23:32 pm »
Here is a low parts count design.

Note you have to size the resistors according to the input line.
Also note that R8 and R9 may be needed to decrease the fall time because the 4N35 opto's are pretty slow.
There maybe a little phase shift (test that) so it also depends exactly how accurate you need to detect the zero crossing point.

I used the schematic from post #35 as a starting point for the drawing itself.
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #46 on: December 27, 2024, 12:05:58 am »
This was my mistake not his (Analog Kid), as I didn't read whom the OP author was when first replying as I thought I had put the user on the ignore list so I didnt interact any more and get pissed at him.

Please, by all means do put me on your ignore list.
You're just a snob, and an unhelpful asshole to boot.
 

Online Analog KidTopic starter

  • Frequent Contributor
  • **
  • Posts: 862
  • Country: us
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #47 on: December 27, 2024, 12:07:45 am »
Here is a low parts count design.

Note you have to size the resistors according to the input line.
Also note that R8 and R9 may be needed to decrease the fall time because the 4N35 opto's are pretty slow.
There maybe a little phase shift (test that) so it also depends exactly how accurate you need to detect the zero crossing point.

I used the schematic from post #35 as a starting point for the drawing itself.

Thanks.
My zero-crossing detector wouldn't need any line isolation like that.
If you wouldn't mind, could you tell us what the output waveforms look like? And how would we deal with the two separate outputs?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20250
  • Country: gb
  • 0999
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #48 on: December 27, 2024, 11:05:25 am »
Here is a low parts count design.

Note you have to size the resistors according to the input line.
Also note that R8 and R9 may be needed to decrease the fall time because the 4N35 opto's are pretty slow.
There maybe a little phase shift (test that) so it also depends exactly how accurate you need to detect the zero crossing point.

I used the schematic from post #35 as a starting point for the drawing itself.
I would just use an opto-coupler with an AC input, rather than two opto-couplers.
https://www.vishay.com/docs/83608/83608.pdf

Here is a low parts count design.

Note you have to size the resistors according to the input line.
Also note that R8 and R9 may be needed to decrease the fall time because the 4N35 opto's are pretty slow.
There maybe a little phase shift (test that) so it also depends exactly how accurate you need to detect the zero crossing point.

I used the schematic from post #35 as a starting point for the drawing itself.

Thanks.
My zero-crossing detector wouldn't need any line isolation like that.
If you wouldn't mind, could you tell us what the output waveforms look like? And how would we deal with the two separate outputs?

What are you talking about?  There is only one output. Take another look at the circuit.
 

Offline Xena E

  • Frequent Contributor
  • **
  • Posts: 609
  • Country: gb
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #49 on: December 27, 2024, 04:26:46 pm »
This was my mistake not his (Analog Kid), as I didn't read whom the OP author was when first replying as I thought I had put the user on the ignore list so I didnt interact any more and get pissed at him.

Please, by all means do put me on your ignore list.
You're just a snob, and an unhelpful asshole to boot.

Thank you! I did, but for some reason the forum started to display them again.

It's sorted now though.

I dont know why unhelpful? I suggested upthread that you just feed a bridge rectifier waveform into the AoE circuit and it's job done... but not realising it was you that was TS.

As you don't appreciate people being helpful, (don't understand, or have another agenda), I've saved you from reviewing my posts and have had them deleted in this thread.

Please accept my profound appologies for interupting your trolling.

Regards.
X (Dr Asshole)


 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20250
  • Country: gb
  • 0999
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #50 on: December 27, 2024, 05:54:59 pm »
I dont know why unhelpful? I suggested upthread that you just feed a bridge rectifier waveform into the AoE circuit and it's job done...
In fairness it's not as simple as taking the output from the bridge rectifier and connecting it to the AoE circuit. Note D1 & D2 and R6 & R7 in my circuit.
 

Offline Xena E

  • Frequent Contributor
  • **
  • Posts: 609
  • Country: gb
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #51 on: December 27, 2024, 06:16:35 pm »
I dont know why unhelpful? I suggested upthread that you just feed a bridge rectifier waveform into the AoE circuit and it's job done...
In fairness it's not as simple as taking the output from the bridge rectifier and connecting it to the AoE circuit. Note D1 & D2 and R6 & R7 in my circuit.

2470933-0
Regards,
X.
« Last Edit: December 27, 2024, 07:48:55 pm by Xena E »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20250
  • Country: gb
  • 0999
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #52 on: December 27, 2024, 07:33:58 pm »
The only addition is a diode that isolates the bridge rectifier from the subsequent reservoir capacitor, however the basic circuit will work as I describe.
Like this?

* Zero cross bridge rectifier diode drop.asc (3.29 kB - downloaded 5 times.)

That's the part I wanted to avoid, because it introduces an additional voltage drop.

Another option is to use two bridge rectifiers, with eliminates the additional diode drop. There are always several ways to solve the problem.

* Zero cross 2 bridge rectifiers.asc (4 kB - downloaded 5 times.)
« Last Edit: December 27, 2024, 07:36:32 pm by Zero999 »
 

Offline Xena E

  • Frequent Contributor
  • **
  • Posts: 609
  • Country: gb
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #53 on: December 27, 2024, 07:57:06 pm »
The only addition is a diode that isolates the bridge rectifier from the subsequent reservoir capacitor, however the basic circuit will work as I describe.
Like this?
(Attachment Link)
(Attachment Link)

That's the part I wanted to avoid, because it introduces an additional voltage drop.

Another option is to use two bridge rectifiers, with eliminates the additional diode drop. There are always several ways to solve the problem.
(Attachment Link)
(Attachment Link)
Thank you!

Yes, (almost) exactly. I messed up putting the circuit in the previous post, but it's there now, just lost the body of text, (no loss).

The diode drop being a problem would depend on application. IME no real problem as theres usually headroom for the ubiquitous regulators anyhow.

X
« Last Edit: December 27, 2024, 07:59:06 pm by Xena E »
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3351
  • Country: au
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #54 on: December 28, 2024, 03:05:41 am »
The only addition is a diode that isolates the bridge rectifier from the subsequent reservoir capacitor, however the basic circuit will work as I describe.
Like this?
(Attachment Link)
(Attachment Link)

That's the part I wanted to avoid, because it introduces an additional voltage drop.

Another option is to use two bridge rectifiers, with eliminates the additional diode drop. There are always several ways to solve the problem.
(Attachment Link)
(Attachment Link)
In the second circuit with two bridges, D2 and D4 are unnecessary.
 
The following users thanked this post: Zero999, Xena E

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20250
  • Country: gb
  • 0999
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #55 on: December 28, 2024, 12:02:14 pm »
The only addition is a diode that isolates the bridge rectifier from the subsequent reservoir capacitor, however the basic circuit will work as I describe.
Like this?
(Attachment Link)
(Attachment Link)

That's the part I wanted to avoid, because it introduces an additional voltage drop.

Another option is to use two bridge rectifiers, with eliminates the additional diode drop. There are always several ways to solve the problem.
(Attachment Link)
(Attachment Link)
In the second circuit with two bridges, D2 and D4 are unnecessary.
That's true, as they're in parallel with D6 & D8. When I drew the schematic, I assumed D1 to D4 and D5 to D8 are bridge rectifier ICs, not discrete components. I suppose you could go for a high power bridge rectifier for D1 to D4, skip D6 & D8 and use low power diodes for D5 & D7.

I also forgot the hysteresis resistor.

For completeness here's the schematic and simulation.
 

Offline Xena E

  • Frequent Contributor
  • **
  • Posts: 609
  • Country: gb
Re: Hey, actually figured something out on my own! (zero-crossing detector)
« Reply #56 on: December 28, 2024, 01:35:31 pm »
The only addition is a diode that isolates the bridge rectifier from the subsequent reservoir capacitor, however the basic circuit will work as I describe.
Like this?
(Attachment Link)
(Attachment Link)

That's the part I wanted to avoid, because it introduces an additional voltage drop.

Another option is to use two bridge rectifiers, with eliminates the additional diode drop. There are always several ways to solve the problem.
(Attachment Link)
(Attachment Link)
In the second circuit with two bridges, D2 and D4 are unnecessary.
That's true, as they're in parallel with D6 & D8. When I drew the schematic, I assumed D1 to D4 and D5 to D8 are bridge rectifier ICs, not discrete components. I suppose you could go for a high power bridge rectifier for D1 to D4, skip D6 & D8 and use low power diodes for D5 & D7.

I also forgot the hysteresis resistor.

For completeness here's the schematic and simulation.
(Attachment Link)
Very good, thank you.

The advantage of the scheme is that in the conjuction a fast enough diode type is used in the position of D5/D7 of your circuit, the input frequency that can be sampled giving a directly proportional output pulse that is then only likely to be limited by the slew rate of the comparator, overcoming the problems associated with a fixed pulse period, as in Tooki's scenario of the Aircraft 400Hz system, or slow rectifier diodes.

In other words, in higher frequency applications, don't use 1Nx400X series rectifiers.

X
 

Offline RJSV

  • Super Contributor
  • ***
  • Posts: 2734
  • Country: us
   The classic case, using logic, could just be implemented in discrete parts.
In the classic edge detect, your logical AND will have a direct input, that maybe just came up, (to a logical 'one', and that is paired with a slightly delayed copy.
   With this,  you've got a window of a short time,  (and also thru an inverter), so that the opportunity is short,  and, soon that logical 'and' function won't have both inputs in the correct form (that is, both logical 'one').
 
   But a rising edge will make it through that, for the short time, before the AND gate stops.
Of course,  you will need to do that in logical equivalents, when using discrete parts, including the negative Boolean logic, where a logical 'OR' will act as a 'negative logic' AND gate.

   That means that a zero with a zero will satisfy the AND, in negative logic sense.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf