Voltage comparator - Page 1
Forum section: electronics / projects

author: OM222O
author_rank: Frequent Contributor
timestamp: April 29, 2019, 12:33:34 pm
content: I'm becoming interested in making a frequency counter and the software part is all done.I just needed a way to convert any incoming signal to a clean square wave so my first idea was to use an op amp / voltage comparator in schmitt trigger mode to do that. my main questions is: what do I need to look out in the op amp spec for high frequency applications? let's say I want about 20MHz bandwidth. should I care about slew rate as it's purely just switching between two states? is gain bandwidth product important in this configuration? would a dedicated voltage comparator be more suitable in this application?And finally if op amps / comparators can't provide that much bandwidth, what's the simplest way I can make a voltage comparator using BJTs?

author: ArthurDent
author_rank: Super Contributor
timestamp: April 29, 2019, 01:05:26 pm
content: The way it was explained to me was that you can view the rise time of a square wave as a clipped sine wave of infinite frequency. The faster rise time will give a more precise trigger point so slew rate is important. Have you considered a high speed amp followed by a fast logic gate.

author: OM222O
author_rank: Frequent Contributor
timestamp: April 29, 2019, 01:27:07 pm
content: I won't need a logic gate as I'm currently running on an LPC1768 uC which runs at about 100 or 140MHz (can't remember but it's plenty fast enough) with interrupts on rising edge and a 5 second rolling average for that extra bit of accuracy! that being said, yes I had a look at op amps and fast ones seem to be application specific, for example driving a video signal. This one from TI seems overkill and costs about 5$ which is acceptable.http://www.ti.com/lit/ds/symlink/opa855.pdfbut again I'm not sure what spec to look for? Recovery time? slew rate? bandwidth?here are a few cheaper alternatives that I can use for testing but I'm not sure which one to order due to not knowing which spec I should optimize for.http://www.ti.com/lit/ds/symlink/opa355.pdfhttps://www.mouser.co.uk/datasheet/2/609/ADA4851-1_4851-2_4851-4-878231.pdf

author: David Hess
author_rank: Super Contributor
timestamp: April 29, 2019, 02:22:49 pm
content: Do not use an operational amplifier; they are only suitable for low speed comparator applications.20 MHz will require higher speed than common comparators like the 150 nanosecond LM311 or 300 nanosecond LM339/LM393 will support. The 10 nanosecond LT1016 would be a good choice or the 12 nanosecond LT1116 if single supply operation is required.Faster designs would likely use discrete differential amplifier stages followed by just a suitably fast logic gate.

author: OM222O
author_rank: Frequent Contributor
timestamp: April 29, 2019, 02:51:42 pm
content: did you even look at the data sheets of the op amps I posted? the first one has 8GHz bandwidth and 2.7KV/uS slew rate, not to mention 3nS recovery timewhat part of that is "low speed"?also the parts you mentioned seem fine but this TI one seems to have just 4.5nS rise and fall time?http://www.ti.com/lit/ds/symlink/tlv7031.pdf?HQS=TI-null-null-mousermode-df-pf-null-wwe&DCM=yes&ref_url=https%3A%2F%2Fwww.mouser.co.uk%2FI don't strictly care about propagation delay as the period is the most important thing here, I don't even require the output to have a balanced duty cycle (i.e: close to 50%). I'm not sure if I'm missing something here (for example if I should care about propagation delay as it affects frequency response somehow? )

author: Benta
author_rank: Super Contributor
timestamp: April 29, 2019, 03:27:27 pm
content: The classic way as done by HP and others is a JFET input stage followed by an MC10H115 or MC10H116 line receiver with the stages in series.

author: OM222O
author_rank: Frequent Contributor
timestamp: April 29, 2019, 03:44:28 pm
content: Quote from: Benta on April 29, 2019, 03:27:27 pmcan you please post a schematic of that? It would be very helpful thanks!

author: IDEngineer
author_rank: Super Contributor
timestamp: April 29, 2019, 05:01:56 pm
content: Quote from: OM222O on April 29, 2019, 12:33:34 pmMaybe you're overthinking this. I don't see any mention of the signal levels you're trying to measure. Schmitt Triggers are literally designed to do exactly what you're describing, and you're going into digital logic anyway. Are you sure you need an analog front end on this?Many MCU's have ST's on their digital inputs. Microchip's PIC series comes to mind. However, I looked at the spec sheet for your MCU and it only appears to use an ST input on its reset pin, so you'll need something external. Still not a problem, as there's no shortage of discrete logic parts with ST's.If the signals are within the range of any off-the-shelf ST's you may be able to just go straight into an ST input presuming that loading of your source isn't the limiting factor. If the signal levels are too high, perhaps a simple voltage divider is all you'll need. You could put it on the input to the ST, in which case run a low-voltage ST part and make the divider switchable to accommodate different ranges of signal levels. Or you could run the ST on higher voltage rails (which you'd need for an analog approach anyway) and then voltage divide its output down to what the MCU expects. This latter approach would lock you to the ST's fixed hysteresis thresholds so it's less flexible.If the signal levels are too low, then yes - you'll need some sort of amplification. And if you need 50/600 ohm termination you'll need to do some extra work. But otherwise you have a lot of potentially simpler options.

author: David Hess
author_rank: Super Contributor
timestamp: April 29, 2019, 05:24:13 pm
content: Quote from: OM222O on April 29, 2019, 02:51:42 pmI did not because an operational amplifier is just not suitable.For instance the OPA855 has a maximum differential input voltage of 1 volt; this could usually be designed around (like in figure 63 discussed below) but it complicates things. Operational amplifiers can do all kinds of weird things when driven into saturation.The OPA855 has a gain-bandwidth product of 8 GHz, not bandwidth. That is impressive for an operational amplifier but peanuts compared to the 50 GHz gain-bandwidth product of an old LT1016.For what it is worth, the reason I suggested the LT1016 is that for a fast comparator, it is easier to use than most because it maintains stability in its active region. Faster devices and older but slower devices tend to be more temperamental.Check out Linear Technology application note 13 for an in depth discussion about the LT1016 and fast comparators in general. Then check out Linear Technology application note 72 which discusses the even faster LT1394 and especially figure 63 on page 29 which shows an adaptive trigger circuit which may be exactly the sort of thing you are looking for although this particular example is AC coupled but that can be changed. The transistor array shown in the schematic can be replaced with individual transistors.QuoteRise and fall time have very little to do with propagation time. If a faster transition time is needed, then a single transistor (or gate) on the output can provide it.QuoteAt 3 microseconds for a TLV7031, a 20 MHz input pulse could and would likely be completely missed.TI does make suitably fast parts; perhaps the LMV7219 would be suitable.Quote from: Benta on April 29, 2019, 03:27:27 pmLine receivers work well but require higher drive levels; voltage comparators have more gain. Line receivers would be good for use in something like a logic analyser input circuit where the input levels are more predictable.

author: OM222O
author_rank: Frequent Contributor
timestamp: April 29, 2019, 05:27:00 pm
content: If you read the first post carefully, I have mentioned that I will be building a schmitt trigger using op amps / voltage comparatorsthe voltage levels are unknown as it will be used as a general purpose frequency counter, so input resistor + schottky diodes are used for high voltage protection, as well as the amplifier stage to clean up the input signal (reference of the schmitt trigger can be adjusted using mosfets and some resistor which are switched in / out of the circuit for the different ranges.I would really like to know how name brand manufacturers like HP did it as Benta mentioned. I really wish he had provided some sort of schematic , more details or where to find those details ...

author: Benta
author_rank: Super Contributor
timestamp: April 29, 2019, 05:27:23 pm
content: Quote from: OM222O on April 29, 2019, 03:44:28 pmUnfortunately I only have these crappy screenshots. The schematic is equivalent to the input stage of an HP 20 MHz counter.A1 and A2 are 1/2 MC10H115, A3 is a fast comparator.It's a nice design, input sensitivity is 50 mV up to 5 V, with attenuator up to 100 V and not really sensitive to overload.

author: IDEngineer
author_rank: Super Contributor
timestamp: April 29, 2019, 05:30:32 pm
content: Quote from: David Hess on April 29, 2019, 05:24:13 pmx2 on that statement, which I didn't say myself because I thought it was common knowledge. Can you use an opamp as a linear comparator? Of course. Should you? No. There's a reason they make dedicated linear comparators, and it's not just speed.Again, if you can keep this in the digital domain with a Schmitt Trigger that would be an excellent solution.

author: OM222O
author_rank: Frequent Contributor
timestamp: April 29, 2019, 05:36:12 pm
content: Quote from: David Hess on April 29, 2019, 05:24:13 pmAs far as I can tell from reading data sheets and a quick google search:propagation delay is just what the name implies: a delay between the output and input where output is supposed to follow the input. by that logic no matter how fast the input is, the output will be the same, but with x amount of delayrise and fall times are what limit the output speed as far as I can tell. please correct me if I'm wrong.

author: OM222O
author_rank: Frequent Contributor
timestamp: April 29, 2019, 05:39:20 pm
content: Quote from: IDEngineer on April 29, 2019, 05:30:32 pmas I mentioned that's simply not possible given the application. what's the best way of implementing a comparator as an schmitt trigger with variable voltage reference (again, switched by fets)The entire reason I'm bringing this up is I actually saw the chinese clones of the frequency counter, which as you said use the PIC uCs to create a very simple frequency counter, however the input is directly connected to the pin of the MCU which is not very good. the original designer has suggested using a pre amplifier to boost the input using a BJT. I just wanted to do it with a digital circuit rather than a common emitter amplifier because as you said, my particular one does not include schmitt triggers built on the IO pins. I'm not sure if the ICs like those slow rising edges of sine waves for example (at low frequencies that is). so I'm open to suggestions as to how I can solve this issue.Edit:here is the original article:https://www.qsl.net/dl4yhf/freq_counter/freq_counter.htmlmany people have tested it and it works surprisingly well (the 5 digit version is the one that chinese have cloned).

author: David Hess
author_rank: Super Contributor
timestamp: April 29, 2019, 06:04:16 pm
content: Quote from: OM222O on April 29, 2019, 05:27:00 pmI can tell you how they did it and it was not by using operational amplifiers as comparators.If the input impedance was high, then first an impedance buffer was used like you would find in an oscilloscope. Then a cascade of limiting amplifiers was used followed by a line receiver, logic gate, or sometimes a two transistor comparator with hysteresis. A modern integrated comparator can replace the cascade of limiting amplifiers to drive logic directly in lower frequency (below 100 MHz) applications.Check out the various old Tektronix and HP frequency and universal counter designs which are fully documented.The example below is from the 125 MHz Tektronix DC503A which does the high impedance conversion using a dual FET to drive a chain of 10216 ECL line receivers used as differential limiting amplifiers. The output from the amplifier chain just goes into a normal ECL gate. A discrete implementation would add hysteresis to the last amplifier stage. Everything shown except the input FET can be replaced by an LT1016 or similar. (1)I have a modern (20 year old) counter which uses an LT1016 for its 10 and perhaps 50 MHz inputs.(1) Do not bother looking for a fast comparator with high impedance inputs to avoid having to use a separate FET input buffer. Such a device is a contradiction in terms.Update: I am not sure what happened to the example so I added it back.

author: duak
author_rank: Super Contributor
timestamp: April 29, 2019, 11:25:47 pm
content: At one time National made a FET input comparator, the LF311. It looks like it was phased out in the 90's. I built a frequency counter in the 70's using one of these things. Even back then it wasn't particularly fast with a response time of 200 ns. This implies a 5 - 10 MHz frequency limit which was just good enough for the rest of the counter.I think David Hess knows of what he speaks. A frequency counter with a good input circuit is a pleasure to use because it isn't fooled by abberations in the input signat. I preferred Tek scopes over hp's because, to me anyway, they had better and more consistant triggering. Since you can't see the trigger points with a frequency counter, how do you know it's the right frequency?

author: rcbuck
author_rank: Frequent Contributor
timestamp: April 30, 2019, 12:37:20 am
content: I used this circuit for the front end of a counter I built last year. It is a slightly modified version of my 1970s Simpson 710 counter that still works fine today. The pot is supposed to be an input sensitivity adjustment. However, I found it has very little effect on the sensitivity. Input sensitivity is about 50 mV from 20 Hz to 60 MHz. It is more sensitive above 1 kHz.You may be better off to just copy the Simpson version. I built an exact copy and it operates the same as my circuit. The Simpson operating manual can be found online and the schematic, although not very clear is at the back of the manual. The sensitivity control in the Simpson also had very little effect on sensitivity so you could just replace it with a fixed 100 ohm resistor. The MC10H116P is available from Mouser.

author: David Hess
author_rank: Super Contributor
timestamp: April 30, 2019, 04:26:12 am
content: Quote from: duak on April 29, 2019, 11:25:47 pmThe LF311 is about the only one I know of and I suspect it was discontinued because it was just a dumb idea. Tektronix used custom hybrids for their logic analyzers which included a JFET buffer followed by an ECL line receiver.The major problem is capacitive coupling between the output and inputs and between the inputs. In an operational amplifier, a small amount of feedback capacitance can be added to neutralized the pole formed by the input resistance and capacitance at the inverting input but comparators are not compensated so that will not work for them. It also will not work for a current feedback amplifier without some additional cleverness.Coupling from the output to the inputs and between the inputs when the source impedances are high can cause all kinds of weirdness. And if you use low source impedances to prevent this, then a high impedance input is no longer required. The corner cases left over where a low input bias current is desirable were just not enough.Of course CMOS input comparators have all of the same problems and the same solutions; drive them with low source impedances.QuoteTektronix's earliest counters used oscilloscope input circuits and they worked great, better than most later counters. The 7D15 shown below is a completely discrete design and includes compensated input attenuators and an HF gain trim. Notice how the trigger level is added to the input signal and only the last stage (1) adds hysteresis and operates with a fixed trigger level; this is effectively a schmitt trigger with one input and one output so no comparator is used even to support a variable trigger level. A tunnel diode based circuit would work this way and support incredibly high speeds.If I was going to duplicate a good but simple design, I would consider the HP 5314/15/16 which uses a JFET buffer to directly drive an AMD (!) AM687 comparator. The comparator then drives a differential pair to create an ECL logic output. (2) These counters support a mode where the level control becomes a sensitivity control and the designer abused the latch enable input of the AM687 to provide this so finding a suitable modern comparator to act this way might be a problem. Replace the JFET with your favorite high bandwidth JFET or CMOS operational amplifier operating as a voltage follower unless you need higher performance.(1) There are two last stages in parallel. One of the two is enabled so triggering on the rising or falling edge is selected instead of trying to invert the analog signal at an earlier point. A modern design could just stick an exclusive-or gate after the comparator to select which edge to use.(2) See the application note I mentioned which discusses comparator level shifters to drive different types of logic.

author: Zero999
author_rank: Super Contributor
timestamp: April 30, 2019, 08:10:40 am
content: Quote from: OM222O on April 29, 2019, 12:33:34 pmYes, use a dedicated comparator IC.Here's some information regarding the pitfalls of interchanging op-amps and comparators.http://encon.fke.utm.my/nikd/latest/sloa067.pdfhttps://www.analog.com/media/en/training-seminars/tutorials/MT-084.pdf

author: OM222O
author_rank: Frequent Contributor
timestamp: April 30, 2019, 11:03:18 am
content: Thanks for the replies, I will buy both the TI and the AD part to see if there are any major differences up to the bandwidth I want (there shouldn't be, but you never know)pretty much every circuit that has been referred to seems to use a JFET input buffer. is this just to create a high impedance input or are there any other reasons? I'm not sure about the input impedance of comparators but op amps have better than good enough input impedance on their own so I'm not sure why the JFET buffer is used.Also I wonder if there is a better way of creating the hysteresis where it doesn't need adjusting the gain based on the inputthe schematics that have been provided so far don't seem to have that but they're a bit too complex for me to see how they have gotten around the trigger point problem. maybe the hysteresis points are chosen close together at something like 50mv and 100mv? rcbuck mentioned that even the professional ones that include sensitivity adjustment don't seem to do much anyways ...

author: Zero999
author_rank: Super Contributor
timestamp: April 30, 2019, 12:25:16 pm
content: Why are you against varying the gain of the pre-amplifier?To vary the hysteresis, simply adjust the feedback resistor value. A digital potentiometer, with sufficient bandwidth and low parasitic capacitance could theoretically be used, but I admit, I haven't investigated whether it's practical or not.http://www.ti.com/lit/ug/tidu020a/tidu020a.pdfAnother method of adjusting the hysteresis, is to use two comparators, each with their own reference, connected to an RS flip-flop.https://www.edn.com/design/analog/4312255/Add-hysteresis-to-a-voltage-comparator

author: OM222O
author_rank: Frequent Contributor
timestamp: April 30, 2019, 12:38:53 pm
content: as I mentioned, in the schematics that have been posted non of them seem to have adjustable hysteresis or even if they do, it doesn't seem to do much

author: Zero999
author_rank: Super Contributor
timestamp: April 30, 2019, 01:43:40 pm
content: Quote from: OM222O on April 30, 2019, 12:38:53 pmI've just told you how to implement adjustable hysteresis and what do you mean by "it doesn't do much"?

author: OM222O
author_rank: Frequent Contributor
timestamp: April 30, 2019, 03:15:31 pm
content: Quote from: rcbuck on April 30, 2019, 12:37:20 amas he pointed out, the adjustment seems to be pointless for the overall function of the end productso if possible, I would also like to not include it and change my input circuit to take care of that (presumably with some sort of amplification?)

author: duak
author_rank: Super Contributor
timestamp: April 30, 2019, 04:36:09 pm
content: David noted something about the AM687 comparator. I remember a story about one of AMD's fast comparators, maybe the AM686 - the one with TTL outputs. In the mid 80's I had just been hired at a startup and a contractor was battling with one of these comparators for a different project. AMD was not kidding when they talked about sensitivity to layout and choice of bypass caps. My contribution was to suggest adding a shield over the pin side of the PCB which helped. I believe the ultimate solution was to go surface mount when the part became available in that form. The DIP package leadframe just had too much mutual inductance.

author: soldar
author_rank: Super Contributor
timestamp: April 30, 2019, 07:03:04 pm
content: One of the first instruments I designed and built myself around 1975 was a frequency counter and I still have it and it still works. I used TTL SN7490 decade counters, SN7475 latches, SN7447 bcd to 7 segment decoders and 7 segment displays.Crystals were extremely expensive so I used one that I got for 5230 KHz and used a lot of digital circuitry to divide by 5230 and obtain a 1 KHZ signal used as timebase.The signal input amplifier/conditioner was really, really badly designed but I was just starting and that's all I could do. It had two parts. The low frequency part went up to about 1 MHz and a separate amplifier was switched when counting higher frequency. I have sometimes thought I could improve the instrument by replacing this part and leaving the rest as it is.Conditioning the signal is not as obvious or straightforward as it might seem at first. How many cycles or pulses do you want to count in the attached graphic?

author: OM222O
author_rank: Frequent Contributor
timestamp: April 30, 2019, 07:21:59 pm
content: Quote from: soldar on April 30, 2019, 07:03:04 pmideally 4 (actual value) but there are spikes all over the shop and my hysteresis would be close to ground, so it would be counting 5(spike on the 3rd wave causing a false count)

author: soldar
author_rank: Super Contributor
timestamp: April 30, 2019, 08:19:46 pm
content: These things can get very tricky. Do you count only zero crossings in one direction? with how much hysteresis? Too much and you can miss some in low amplitude waveforms. Too little and you can get false triggering in higher amplitude waveforms. Ideally you would first normalize the signal.What about when you have something like a high frequency signal summed with a lower frequency signal? Do you want to count one or the other?

author: IDEngineer
author_rank: Super Contributor
timestamp: April 30, 2019, 09:16:08 pm
content: The two waveform examples suggest filtering is important too. I did a search and this post is the first in this thread with the word "filter" in it.I acknowledge that if the frequency counter is measuring something that another circuit will depend upon, that other circuit may also be fooled by unexpected frequency components. But that doesn't mean they can be ignored! If your counter can be fooled, so too may your actual circuit be fooled.Itlooks(pun intended) like observing the signal with a scope or SA might be really good insurance before relying on the accuracy of the frequency counter. The latter may be fooled by spurious frequency content, but the scope should be able to image it (presuming sufficient bandwidth). Lacking that, perhaps we should include a discussion of front end filters while talking about frequency counters....EDIT: I suppose one could design a pulse discrimination circuit that would only count the transitions that occur on a periodic basis, but I think I'd rather use standard filters.

author: OM222O
author_rank: Frequent Contributor
timestamp: April 30, 2019, 09:19:32 pm
content: I'm not trying any fancy waveforms like you mentioned (two summed up or etc) no frequency counter that I know of can handle those (except with adding filter for frequency range, etc which I don't want to do!) and it will be close to zero (only rising edges) so it's fine. signals aren't as noisy as you made them seem.my main question about the input still remains however:1) what's the jfet used for?2) Is it a good idea to include a common emitter amplifier on the input?edit: inputs are well behaved, I don't want to discuss edge cases / where the input signal is not known / not well behaved

author: IDEngineer
author_rank: Super Contributor
timestamp: April 30, 2019, 09:28:45 pm
content: Quote from: soldar on April 30, 2019, 08:19:46 pmThis makes me wonder: Has anyone designed a DSP-based frequency counter? A lot of these potential problems could be easily addressed if you had some processing power. Seems like one of the T&M shops would have created such a beast by now.

author: OM222O
author_rank: Frequent Contributor
timestamp: April 30, 2019, 09:50:43 pm
content: you could but it would be practically useless ... at that point you just use an scopeno please stay on topic!

author: David Hess
author_rank: Super Contributor
timestamp: May 01, 2019, 02:10:59 am
content: Quote from: duak on April 30, 2019, 04:36:09 pmComparators faster than the LM311 often have stability problems making them difficult to use in practical circuits. One solution to this problem is to include (and use) a latch enable input on the comparator; some parts are simply never stable in their active region unlike the LT1016 and similar later parts which are much easier to use.Quote from: OM222O on April 30, 2019, 11:03:18 amAs I mentioned, if you need a high impedance input and lower bandwidth is acceptable, then you can get away with using a JFET or CMOS input operational amplifier in a voltage follower configuration instead of a discrete JFET or MOSFET. In the past, fast JFET and CMOS input operational amplifier simply were not available.QuoteThe HP 5314/15/16 simply relies on the built in hysteresis in the AM687 comparator that it uses for normal operation and adjusts it in a rather dastardly way in the alternative mode of operation and it definitely has an effect.The first example I gave above has fixed positive feedback around the last differential amplifier stage. The second discrete example has fixed DC positive feedback around the first differential amplifier stage and AC positive feedback around the last differential amplifier stage which is only there to increase switching speed.Usually, hysteresis is fixed in the design and there is no need to adjust it. If you use an integrated comparator like an LT1016, it has no hysteresis built in but you can add it easy enough with a resistor from one of its outputs to one of its inputs. Making the hysteresis adjustable would be tricky unless you can pull off what HP did with the HP 5314/15/16; offhand I do not know what modern parts are suitable for that kind of implementation.But I think the above is largely irrelevant because you can get great performance up to 25 or even 50 MHz with just two parts. Pick your favorite fast JFET or CMOS operational amplifier for use as a voltage follower to buffer the high impedance inputs, maybe an AD8065, and use it to drive an LT1016 or similar with an external positive feedback resistor to add fixed hysteresis; it should only require millivolts to 10s of millivolts for good operation.You will probably want a compensated divider before the buffer to increase the input voltage range and to protect the input from over-voltage conditions. A high impedance input also allows the use of a x10 oscilloscope probe for added protection and input voltage range.The LT1016 or similar will be easier to use than the TI part I mentioned because it has complementary outputs; use one to drive the logic and the other to provide hysteresis. TI has some similar parts I think.If a 50 ohm input is acceptable, then you can drive the input to the comparator directly without a high impedance buffer.

author: OM222O
author_rank: Frequent Contributor
timestamp: May 01, 2019, 11:22:11 am
content: I decided to use the LT1016 for now.For the input stage the jfet input amps are just too slow (45MHz GBWP was the best mouser had!) but CMOS ones are better.The cheapest I could find for 100MHz was this one:http://www.ti.com/lit/ds/symlink/tlv3541.pdfbut on the other hand I'm inclined to use a and a common collector amplifier (unity gain, just converts impedances) instead of an OP amp and common emitter amplifier for the gain stage as they have higher bandwidth compared to op amps. is that a viable option or am I going down the wrong rabbit hole and just using a cmos op amp for input and a high speed op amp for gain is the better solution?

author: OM222O
author_rank: Frequent Contributor
timestamp: May 01, 2019, 04:43:38 pm
content: update:I ran some simulations using LTSpice and the LT1116 seems to be totally useless at 20Meg (lower frequencies are ok)So I tried the LT1016 which seems pretty bad toois there something wrong with my circuit? or are these comparator just not fast enough?

author: duak
author_rank: Super Contributor
timestamp: May 01, 2019, 06:45:36 pm
content: You've got rather a lot of hysteresis there OM. Try varying the value of R1 between 100R and 1K0.The rise and fall times of the outputs are about what the datasheet shows.I used the hp 5315B counter a number of times and found its triggering to be quite useable. The LED indicator was very handy for setting the threshold. I looked at the hp 5316B manual and see that it has some test point connections to observe trigger level. If I were to rebuild my counter, I would add an LED indicator as well as a test point or connector to allow a scope to show the comparator output and actually see the trigger, sort of like the trigger view on some scopes. I would also consider adding a multirange low pass filter tied to the frequency range selector to attenuate noise above the expected range.

author: OM222O
author_rank: Frequent Contributor
timestamp: May 01, 2019, 09:08:22 pm
content: you are absolutely rightI added a third resistor to add a DC offset to the hysteresis and it works very well now with input voltages as low as 0.2v.I also added a common collector amplifier which increases input impedance by beta x Remitter which should be at least 100x10k which is 1Meg, plenty good enough for now.Again I'm debating if I should add a common emitter amplifier for the gain, or just use a high speed op amp ... fiddling with CE amplifier and biasing point etc has proven to be a nightmare

author: David Hess
author_rank: Super Contributor
timestamp: May 02, 2019, 02:51:28 am
content: Quote from: OM222O on May 01, 2019, 04:43:38 pmThe impedance at the non-inverting input is too high.Also, add a little bit of AC hysteresis at high frequencies with a small capacitor in parallel with R2. Just 10s of picofarads is sufficient.I forgot to mention it but there are some comparators with adjustable hysteresis via an external input. I perused a few but none of them struck me as particularly suitable.If I was going to add variable hysteresis, I would use the comparator's output to drive a diode bridge biased by adjustable currents which then drives the appropriate input. Old fast function generators work this way. If the hysteresis only goes in one direction, then the bridge can be replaced with just two diodes or transistors and one current source. Despite having used this feature on the HP counters I mentioned, I am dubious that it is worth putting that much effort into but it a place in automated test gear.Another intriguing possibility is to drive one of the offset null pins for hysteresis but most comparators lack them.QuoteThe LT1016 is good up to about 50 MHz.