Author Topic: Experimenting with comparators failed: sine to square  (Read 4273 times)

0 Members and 1 Guest are viewing this topic.

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1273
  • Country: ru
Re: Experimenting with comparators failed: sine to square
« Reply #25 on: January 01, 2021, 09:34:02 pm »
You may have damaged the input signal by feedback - it puts a load on the signal source, sometimes this requires a buffering amplifier.
And sorry for my English.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 4064
  • Country: ua
Re: Experimenting with comparators failed: sine to square
« Reply #26 on: January 02, 2021, 02:46:49 am »
Here is Chinese TLV3501 module for 3 USD:
https://www.aliexpress.com/item/4000543686133.html

I tested it from 1 kHz to 80 MHz - works ok.

And here is how it works:
« Last Edit: January 02, 2021, 02:50:19 am by radiolistener »
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 4064
  • Country: ua
Re: Experimenting with comparators failed: sine to square
« Reply #27 on: January 02, 2021, 02:53:05 am »
Also, here is frequency counter on TLV3501.
I didn't tried it, but may be it will help you:
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 502
  • Country: it
Re: Experimenting with comparators failed: sine to square
« Reply #28 on: January 02, 2021, 08:24:17 am »
You may have damaged the input signal by feedback - it puts a load on the signal source, sometimes this requires a buffering amplifier.
sweet
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7724
  • Country: au
Re: Experimenting with comparators failed: sine to square
« Reply #29 on: January 02, 2021, 11:55:14 am »
Hi.
What I want to do is turn my 10M sine wave (from an arb currently, set at 1Vpp, Hi-Z output) to a square wave. As simple as that.
I thought of using a comparatorr and I had a bunch of TLV3501(datasheet) lying around and thought of using one. The shutdown function will come in handy, but currently its SHDN pin has been tied to ground.

You can find a schematic (with a generic comparator) here (Attachment Link)


Now when I probe the output of the comparator I expect some kind of square wave, but instead I have a perfect 110MHz sine wave. Incidentally the same happens when I apply no input. But the input is there (probed it). So there is something I am doing wrong. Can you help me please? Do I need some kind of load? A 10k or 100k resistor won't do the trick.

Thanks


How do you manage to use a comparator to increase your input frequency by a factor of eleven?
If you can reproduce this you are financially "set" for life, especially, if you can achieve other multiplication factors. ;D

Maybe your comparator coincidentally, just likes to oscillate at 110MHz?
Have you checked for output with the input wiring connected, but the 10MHz source turned off?

 

Offline Wallace Gasiewicz

  • Super Contributor
  • ***
  • Posts: 1339
  • Country: us
Re: Experimenting with comparators failed: sine to square
« Reply #30 on: January 02, 2021, 12:55:25 pm »
S. Petrukhin is correct. The input voltage and the reference voltages have to "cross" in order for the comparator to change output from pos to neg (or the other way)
Your input is plus minus one volt and your reference is +2.5 volt. The input never "crosses" the reference voltage. Input has to get to at least 2.5 Volts to change output, and then go below 2.5 V to change again to get your square wave.
Can you increase your input voltage to 3 volts??? That would be 6 volts peak to peak. You will then get a square wave that goes from zero to VCC and back.
OR as I said before try setting the reference to GND.

There are circuits that do use the comparator for an oscillator,but 110 MHZ???

Probably intrinsic to the comparator somehow????
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20001
  • Country: gb
  • 0999
Re: Experimenting with comparators failed: sine to square
« Reply #31 on: January 02, 2021, 01:08:30 pm »
Hi.
What I want to do is turn my 10M sine wave (from an arb currently, set at 1Vpp, Hi-Z output) to a square wave. As simple as that.
I thought of using a comparatorr and I had a bunch of TLV3501(datasheet) lying around and thought of using one. The shutdown function will come in handy, but currently its SHDN pin has been tied to ground.

You can find a schematic (with a generic comparator) here (Attachment Link)


Now when I probe the output of the comparator I expect some kind of square wave, but instead I have a perfect 110MHz sine wave. Incidentally the same happens when I apply no input. But the input is there (probed it). So there is something I am doing wrong. Can you help me please? Do I need some kind of load? A 10k or 100k resistor won't do the trick.

Thanks


How do you manage to use a comparator to increase your input frequency by a factor of eleven?
If you can reproduce this you are financially "set" for life, especially, if you can achieve other multiplication factors. ;D

Maybe your comparator coincidentally, just likes to oscillate at 110MHz?
Have you checked for output with the input wiring connected, but the 10MHz source turned off?
We haven't seen the layout: poor construction can cause oscillation. If it's built on a breadboard, with the TLV3501 on one of those SMD to DIP adaptor boards of course, it wouldn't be surprising if it oscillates.

As far as multiplying the frequency by 11 is concerned: harmonic filtering is a method to multiply one frequency by a fixed amount, but it only works over a limited frequency range. It's not impossible that there's a tuned circuit at around the 110MHz mark which is selecting the 11th harmonic, in which case increasing/decreading the input frequency a little will cause the output frequency to change proportionally.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17215
  • Country: us
  • DavidH
Re: Experimenting with comparators failed: sine to square
« Reply #32 on: January 02, 2021, 10:49:04 pm »
The reference voltage can be derived from the input using the "data slicer" configuration.

Alternatively the reference voltage can be derived from the output to force a 50% duty cycle.
« Last Edit: January 02, 2021, 10:52:12 pm by David Hess »
 
The following users thanked this post: MK14, Moriambar

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7724
  • Country: au
Re: Experimenting with comparators failed: sine to square
« Reply #33 on: January 03, 2021, 01:03:29 am »

We haven't seen the layout: poor construction can cause oscillation. If it's built on a breadboard, with the TLV3501 on one of those SMD to DIP adaptor boards of course, it wouldn't be surprising if it oscillates.

As far as multiplying the frequency by 11 is concerned: harmonic filtering is a method to multiply one frequency by a fixed amount, but it only works over a limited frequency range. It's not impossible that there's a tuned circuit at around the 110MHz mark which is selecting the 11th harmonic, in which case increasing/decreading the input frequency a little will cause the output frequency to change proportionally.

Not impossible, but most unlikely.
A "one step" frequency multiplication of 11 times is very far from the standard frequency multiplication schemes that were used in the past, which mainly used cascaded frequency doublers & triplers, with the very occasional quadrupler.

The problem with "one step"  frequency multiplication  by large multiples (& why it was rejected as a viable method), is that the amount of harmonic energy available to provide the multipled output is minimal at the higher harmonics.

If it was found unsatisfactory, even with dedicated high "Q" LC resonant circuits, it makes the possibility of it happening "accidentally", unlikely in the extreme.

Another possibility arises, that the comparator is in fact, oscillating at around 110MHz, but it has become "locked" to the incoming 10MHz signal.
To my mind, it would be more likely to lock to 100MHz, though.

The possibility of oscillation is why I suggested the OP leave all the input connections in place, & just turn off the 10MHz source,then check what appears at the output.
Even if a signal  around 110MHz appears at the output, the possibity of "locking" as mentioned sbove  still remains

The best way to check if the input & output signals are in sync would be to monitor the 10MHz signal on one channel of an Oscilloscope, triggering from that input, & look at the 110MHz output on the other channel.

If the latter is stationary on the display, it is, somehow, related to the input 10MHz signal, if not, it is just an unrelated oscillation.






 
The following users thanked this post: Zero999

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 502
  • Country: it
Re: Experimenting with comparators failed: sine to square
« Reply #34 on: January 03, 2021, 03:40:44 pm »
So I discovered many many mistakes but not everything is solved.
Now I have my input signal AC-coupled and I have then biased it in order to obtain some kind of 10MHz square wave.

The result is horrible, but I do not think this is due to the setup directly, since this time touching the leads does not yield anything different.

Is there any way to clean up the signal? Unfortunately now I'm not at my bench so I can't quickly check other things.

Thanks1144232-0
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20001
  • Country: gb
  • 0999
Re: Experimenting with comparators failed: sine to square
« Reply #35 on: January 03, 2021, 05:59:49 pm »
So I discovered many many mistakes but not everything is solved.
Now I have my input signal AC-coupled and I have then biased it in order to obtain some kind of 10MHz square wave.

The result is horrible, but I do not think this is due to the setup directly, since this time touching the leads does not yield anything different.

Is there any way to clean up the signal? Unfortunately now I'm not at my bench so I can't quickly check other things.

Thanks (Attachment Link)
It looks like poor construction. Please post a photograph of the actual circuit.
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 502
  • Country: it
Re: Experimenting with comparators failed: sine to square
« Reply #36 on: January 04, 2021, 01:12:52 pm »
I can't take a picture now, unfortunately. But I think the problem is somewhere else.

Here's my new schematic
1144790-0

What I notice is that probing V+ and V- looks ok, meaning that I see the V- value crossing more or less halfway the 2Vpp 10MHz sine. That looks fine too.

My scope probes are GND referenced and set to 10x.

When I probe the output of the comparator though I get a waveform that is an ugly excuse for a square wave. It is 10MHz, and it is basically very similar to the pic I posted above.

Using some kind of cap from V- to GND remove the jitter, but then I noticed that probing the output actually disturbed the input: probing V+  (channel 1), V- (channel 4) and the output (channel 2)
I have the following pic.
1144794-1

As you can see V- is "disturbed"(V+ too, but to a lesser extent) by the probe on the output, with around 1Vpp.

So I think that I did not either listen to something important or understand something important.

If anyone wants to help, thanks!
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17215
  • Country: us
  • DavidH
Re: Experimenting with comparators failed: sine to square
« Reply #37 on: January 04, 2021, 04:45:16 pm »
The problems do look like poor layout and poor decoupling, but high source impedance can also cause oscillation.  Jim William wrote about problems with comparators specifically:

https://www.analog.com/media/en/technical-documentation/application-notes/an13f.pdf
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 502
  • Country: it
Re: Experimenting with comparators failed: sine to square
« Reply #38 on: January 04, 2021, 05:41:16 pm »
The problems do look like poor layout and poor decoupling, but high source impedance can also cause oscillation.  Jim William wrote about problems with comparators specifically:

https://www.analog.com/media/en/technical-documentation/application-notes/an13f.pdf
this is a wonderful read, thanks.
My mistake was: long ground leads.
Now I'll just have to adjust the V- voltage in order to have 50% duty cycle, I think I can pick it up from here.

thanks for the link again
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf