Finding mistake in this circuit

Thread Starter

Bamerni

Joined Jun 26, 2016
53
Hello everyone

I hope if someone can tell me the mistake or (misunderstand) in this electronic circuit

My aim is to build a simple comparator circuit in which the output is high (I suppose it should be 5 voltage) when the instantaneous value of input 1 exceeds the threshold DC value at input 2, and the output is zero when the instantaneous value of input 1 exceeds the threshold DC value at input 2.

my colleagues suggested the LM311 operation amplifier to me as the best choice.

I connected the circuit first using Multisim 14, but unfortunately, the output is not like what I expected.

First, the output is negative and it is not equal the Vcc voltage (5 volts) and it is even not constant and varies many times

I connected the circuit practically like what I do in Multisim and the result is same

I upload my circuit to see what I was exactly do

So, can anyone help me find the mistake in the circuit or if there is a misunderstanding from me? and what are your suggestions to solve my problem and get the exact output?
thank you in advance


compartor.png output.png
 

Thread Starter

Bamerni

Joined Jun 26, 2016
53
After I do the change, the circuit output now become 5 volts like what I expected

but why I get the wrong output at the region circulated with a red circle as shown below

output2.png
 

JohnInTX

Joined Jun 26, 2012
4,787
According to the datasheet, pins 5 and 6 should be shorted if you don't have a trimpot connected to avoid oscillations around the switch point. They act as aux inputs.
Back when I was doing analog, I remember the 311 as particularly prone to oscillations and used hysteresis on the inputs. Your input signal has noise on it so it is not unreasonable to expect that the 311 switches on the noise when the main signal approaches the switching threshold.
pp12 of the attached datasheet describes other things you might try.
http://www.ti.com/general/docs/lit/getliterature.tsp?genericPartNumber=lm111-n&fileType=pdf
Good luck!
 

Thread Starter

Bamerni

Joined Jun 26, 2016
53
According to the datasheet, pins 5 and 6 should be shorted if you don't have a trimpot connected to avoid oscillations around the switch point. They act as aux inputs.
Back when I was doing analog, I remember the 311 as particularly prone to oscillations and used hysteresis on the inputs. Your input signal has noise on it so it is not unreasonable to expect that the 311 switches on the noise when the main signal approaches the switching threshold.
pp12 of the attached datasheet describes other things you might try.
http://www.ti.com/general/docs/lit/getliterature.tsp?genericPartNumber=lm111-n&fileType=pdf
Good luck!
Thank for your reply

I short circuited pin 5 and 6 but no change

In fact, my input signal is pure Gaussian noise

I tried sine wave as a test signal and the output is as shown below

I wondering why the output is 5 volts when the input is at the negative half ???

shouldn't it be zero because the input is less than the reference voltage (1 volt) ???

output3.png
 

WBahn

Joined Mar 31, 2012
30,087
Thank for your reply

I short circuited pin 5 and 6 but no change

In fact, my input signal is pure Gaussian noise

I tried sine wave as a test signal and the output is as shown below

I wondering why the output is 5 volts when the input is at the negative half ???

shouldn't it be zero because the input is less than the reference voltage (1 volt) ???
Your input voltage is going below the negative supply rail, so you are venturing into undefined territory. Keep your input signals constrained to be within your supply rails.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Thank for your reply

I short circuited pin 5 and 6 but no change

In fact, my input signal is pure Gaussian noise

I tried sine wave as a test signal and the output is as shown below

I wondering why the output is 5 volts when the input is at the negative half ???

shouldn't it be zero because the input is less than the reference voltage (1 volt) ???

View attachment 131545
Aren't the inputs of most op amps limited to within the supply voltage range? I think when your input voltage goes below ground (negative voltages) that it's an unacceptable input. Many (most?) ICs have limited tolerance of such things, often limited to roughly one diode's forward voltage drop. If my memory is correct on all these points (dubious at best,) then whenever the input signal drops more than a diode drop negative (maybe -0.6 to -0.7V) you can expect unpredictable behavior. Perhaps that's why the output goes high again when the input signal goes too far below ground?
 

Thread Starter

Bamerni

Joined Jun 26, 2016
53
Your input voltage is going below the negative supply rail, so you are venturing into undefined territory. Keep your input signals constrained to be within your supply rails.
Thank you for your reply

OK so what you suggest to me

Can I connect a negative voltage to pin 4 and 1? is that correct the negative voltage problem
 

WBahn

Joined Mar 31, 2012
30,087
Thank you for your reply

OK so what you suggest to me

Can I connect a negative voltage to pin 4 and 1? is that correct the negative voltage problem
Pin 1 is the emitter of the output transistor. You want it connected to the supply level that you want your output signal to have when the output is LO.

But connect pin 4 to -Vcc.
 
The LM311 is a very early and popular in the day comparitor. You might try to look at the LT6700 series of chips. http://www.linear.com/product/LT6700 There are single and dual versions and they all contain a 400 mV reference.

It's also an LT "over the top" product where the inputs can exceed the power supply rails which is unusual.

Before actually using one, make sure you can obtain it.
 

AnalogKid

Joined Aug 1, 2013
11,056
A common "feature" of early opamps and comparators is that when the input is way overdriven, the output inverts. Newer parts have internal circuits to prevent this. For older parts, sometimes all you need is aresistor in series with the input, but better to add a small signal diode after the resistor, from the input (anode) to GND (cathode). This clips large negative excursions to 1 diode drop below the negative rail and prevents output inversion. The series resistor limits the current through the diode.

ak
 

Thread Starter

Bamerni

Joined Jun 26, 2016
53
The LM311 is a very early and popular in the day comparator. You might try to look at the LT6700 series of chips. http://www.linear.com/product/LT6700 There are single and dual versions and they all contain a 400 mV reference.

It's also an LT "over the top" product where the inputs can exceed the power supply rails which is unusual.

Before actually using one, make sure you can obtain it.
Thank you for your reply

I tried this comparator in MultiSim and I found that the response of it is slower than LM311

Now my circuit work correctly, but now my problem is that it not work with high frequencies (> MHz) and I need such high frequencies

Is there any method or suggestion for this problem?
 

Thread Starter

Bamerni

Joined Jun 26, 2016
53
A common "feature" of early opamps and comparators is that when the input is way overdriven, the output inverts. Newer parts have internal circuits to prevent this. For older parts, sometimes all you need is aresistor in series with the input, but better to add a small signal diode after the resistor, from the input (anode) to GND (cathode). This clips large negative excursions to 1 diode drop below the negative rail and prevents output inversion. The series resistor limits the current through the diode.

ak
As I understand you mean to cut the negative portion of the signal, so it is work with the positive portion only.

isn't true?
 
Top